'After a ``POST`` to the ``signup`` view a new user should be created,
the user should be logged in and redirected to the signup success page.'

def test_signup_view_with_signin(self):

    userena_settings.USERENA_SIGNIN_AFTER_SIGNUP = True
    userena_settings.USERENA_ACTIVATION_REQUIRED = True
    response = self.client.post(reverse('userena_signup'), data={'username': 'alice', 'email': 'alice@example.com', 'password1': 'blueberry', 'password2': 'blueberry', 'tos': 'on'})
    userena_settings.USERENA_SIGNIN_AFTER_SIGNUP = False
    userena_settings.USERENA_ACTIVATION_REQUIRED = True
    response_check = self.client.get(reverse('userena_profile_edit', kwargs={'username': 'alice'}))
    self.assertEqual(response_check.status_code, 403)
    userena_settings.USERENA_SIGNIN_AFTER_SIGNUP = True
    userena_settings.USERENA_ACTIVATION_REQUIRED = False
    response = self.client.post(reverse('userena_signup'), data={'username': 'johndoe', 'email': 'johndoe@example.com', 'password1': 'blueberry', 'password2': 'blueberry', 'tos': 'on'})
    userena_settings.USERENA_SIGNIN_AFTER_SIGNUP = False
    userena_settings.USERENA_ACTIVATION_REQUIRED = True
    response_check = self.client.get(reverse('userena_profile_edit', kwargs={'username': 'johndoe'}))
    self.assertEqual(response_check.status_code, 200)
