def assert_reset_password(self, api_client, password_data): response = api_client.post(self.reset_password_url, data=password_data) response_json = response.json() assert response.status_code == status.HTTP_200_OK assert has_response_format(response) assert response_json['code'] == response_codes.RESET_PASSWORD_SENT[ 'code'] assert mail_outbox() == 1
def test_register_with_email_confirmation(self, api_client, test_user): allow(UserService).register_new_user.and_return(test_user) user_data = generate_user_profile() response = api_client.post(self.register_url, user_data) response_json = response.json() assert response.status_code == status.HTTP_200_OK assert mail_outbox() == 1 assert response_json.get('code') == AccountsResponses.CONFIRMATION_EMAIL_SENT.get('code')
def test_send_reset_password(test_user): AuthEmailService.send_reset_password( PendingActionFactory(user=test_user, category=ActionCategory.RESET_PASSWORD)) assert mail_outbox() == 1
def test_send_confirm_email(test_user): AuthEmailService.send_confirm_email( PendingActionFactory(user=test_user, category=ActionCategory.CONFIRM_EMAIL)) assert mail_outbox() == 1
def test_send_confirmation_email__with_new_email(test_user): AuthService.send_confirmation_email(test_user, new_email='*****@*****.**') assert mail_outbox() == 1
def test_send_confirmation_email(test_user): AuthService.send_confirmation_email(test_user) assert mail_outbox() == 1