Projet

Général

Profil

0001-cards-display-first-history-step-with-agent-name-396.patch

Frédéric Péters, 22 février 2020 10:58

Télécharger (1,64 ko)

Voir les différences:

Subject: [PATCH] cards: display first history step with agent name (#39667)

 tests/test_backoffice_pages.py | 7 +++++++
 wcs/carddata.py                | 8 ++++++++
 2 files changed, 15 insertions(+)
tests/test_backoffice_pages.py
5489 5489
    assert 'Edit Card' in resp.text
5490 5490
    assert 'Delete Card' in resp.text
5491 5491

  
5492
    carddata = carddef.data_class().select()[0]
5493
    assert carddata.data == {'1': 'ok', '2': 'blah'}
5494
    assert carddata.user_id is None
5495
    assert carddata.submission_context == {'agent_id': user.id}
5496
    assert carddata.evolution[0].who == str(user.id)
5497
    assert 'Original Submitter' not in resp.text
5498

  
5492 5499
    resp = app.get('/backoffice/data/')
5493 5500
    resp = resp.click('foo')
5494 5501
    assert resp.text.count('<tr') == 2  # header + row of data
wcs/carddata.py
47 47

  
48 48
    def get_display_label(self):
49 49
        return self.digest or self.get_display_name()
50

  
51
    def get_author_qualification(self):
52
        return None
53

  
54
    def just_created(self):
55
        super(CardData, self).just_created()
56
        agent_id = self.submission_context.get('agent_id')
57
        self.evolution[0].who = agent_id
50
-