diff --git a/src/authentic2_auth_fc/authenticators.py b/src/authentic2_auth_fc/authenticators.py index b28ade7bf..c88bfca29 100644 --- a/src/authentic2_auth_fc/authenticators.py +++ b/src/authentic2_auth_fc/authenticators.py @@ -79,3 +79,6 @@ class FcAuthenticator(BaseAuthenticator): } ) return render_to_string('authentic2_auth_fc/linking.html', context, request=request) + + def registration(self, request, *args, **kwargs): + return self.login(request, *args, **kwargs) diff --git a/tests/auth_fc/test_auth_fc.py b/tests/auth_fc/test_auth_fc.py index 624a0706f..88607cff5 100644 --- a/tests/auth_fc/test_auth_fc.py +++ b/tests/auth_fc/test_auth_fc.py @@ -535,3 +535,18 @@ def test_authorization_error(app, franceconnect): messages = response.pyquery('.messages').text() assert error in messages assert error_description not in messages + + +def test_registration_page(settings, app, franceconnect, hooks): + assert User.objects.count() == 0 + response = app.get('/accounts/register/?service=portail&next=/idp/') + response = franceconnect.login_with_fc_fixed_params(app) + + # a new user has been created + assert User.objects.count() == 1 + + # we must be connected + assert app.session['_auth_user_id'] + + # hook must have been called + assert hooks.calls['event'][0]['kwargs']['name'] == 'fc-create'