Projet

Général

Profil

0001-auth_fc-provide-a-clearer-unlink-confirmation-messag.patch

Paul Marillonnet, 14 septembre 2022 16:55

Télécharger (3,28 ko)

Voir les différences:

Subject: [PATCH] auth_fc: provide a clearer unlink confirmation message
 (#68367)

 src/authentic2_auth_fc/views.py | 2 +-
 tests/auth_fc/test_auth_fc.py   | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)
src/authentic2_auth_fc/views.py
591 591
        for link in links:
592 592
            logger.info('auth_fc: user %s unlinked from %s', self.request.user, link)
593 593
        hooks.call_hooks('event', name='fc-unlink', user=self.request.user)
594
        messages.info(self.request, _('The link with the FranceConnect account has been deleted.'))
594
        messages.info(self.request, _('Your account link to FranceConnect has been deleted.'))
595 595
        links.delete()
596 596
        # FC mapping config may have changed over time, hence it is impossible to tell which
597 597
        # attribute was verified at FC link time.
tests/auth_fc/test_auth_fc.py
151 151
    response = franceconnect.handle_logout(app, response.location)
152 152
    assert path(response.location) == '/accounts/'
153 153
    response = response.follow()
154
    assert 'The link with the FranceConnect account has been deleted' in response
154
    assert 'Your account link to FranceConnect has been deleted' in response
155 155

  
156 156

  
157 157
def test_create_no_unicode_collision(settings, app, franceconnect, hooks, service):
......
217 217
    response = response.click('Delete link')
218 218
    assert 'new_password1' not in response.form.fields
219 219
    response = response.form.submit(name='unlink').follow()
220
    assert 'The link with the FranceConnect account has been deleted' in response.text
220
    assert 'Your account link to FranceConnect has been deleted' in response.text
221 221
    # no logout from FC since we are not logged to it
222 222
    assert response.request.path == '/accounts/'
223 223

  
......
234 234
    response = franceconnect.handle_logout(app, response.location)
235 235
    assert path(response.location) == '/accounts/'
236 236
    response = response.follow()
237
    assert 'The link with the FranceConnect account has been deleted' in response
237
    assert 'Your account link to FranceConnect has been deleted' in response
238 238

  
239 239

  
240 240
def test_login_email_is_unique_and_already_linked(settings, app, franceconnect, caplog):
......
370 370
    response = franceconnect.handle_logout(app, response.location)
371 371
    assert path(response.location) == '/accounts/'
372 372
    response = response.follow()
373
    assert 'The link with the FranceConnect account has been deleted' in response
373
    assert 'Your account link to FranceConnect has been deleted' in response
374 374
    assert len(response.pyquery('[href*="password/change"]')) > 0
375 375

  
376 376

  
377
-