From 5f96cdc9501bdef8a17363e4d07973ae90fad08c Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Jan 19 2016 15:21:02 +0000 Subject: Add test for when someone creates an account for an existing email --- diff --git a/tests/test_pagure_flask_ui_login.py b/tests/test_pagure_flask_ui_login.py index 6284bf2..24da8fb 100644 --- a/tests/test_pagure_flask_ui_login.py +++ b/tests/test_pagure_flask_ui_login.py @@ -69,7 +69,7 @@ class PagureFlaskLogintests(tests.Modeltests): data = { 'user': 'foo', 'fullname': 'user foo', - 'email_address': 'foo@example.com', + 'email_address': 'foo@bar.com', 'password': 'barpass', 'confirm_password': 'barpass', } @@ -93,10 +93,17 @@ class PagureFlaskLogintests(tests.Modeltests): '
', output.data) self.assertIn('Username already taken.', output.data) - # Submit the form with another user name + # Submit the form with another username data['user'] = 'foouser' output = self.app.post('/user/new', data=data, follow_redirects=True) self.assertEqual(output.status_code, 200) + self.assertIn('New user - Pagure', output.data) + self.assertIn('Email address already taken.', output.data) + + # Submit the form with proper data + data['email_address'] = 'foo@example.com' + output = self.app.post('/user/new', data=data, follow_redirects=True) + self.assertEqual(output.status_code, 200) self.assertIn('Login - Pagure', output.data) self.assertIn( 'User created, please check your email to activate the account',