Skip to content

Commit

Permalink
to improve the email test
Browse files Browse the repository at this point in the history
  • Loading branch information
CHRISTOPHERKADOGO committed Jul 16, 2024
1 parent 833dae7 commit 8974de9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/controllers/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def post(self):
return dict(status="fail", message=errors), 400

email = validated_user_data.get('email', None)

if not is_valid_email(email):
return dict(status='fail', message=f'Invalid email address'), 400

Expand Down
6 changes: 3 additions & 3 deletions app/tests/user/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

class UserBaseTestCase():
user_data = {
'email': 'test_email@testdomain.com',
'email': 'rhodin@cranecloud.io',
'name': 'Test User',
'password': 'Compl3xPassw0rd',
'organisation': 'Makerere',
'phone_number': '+256777777777'
}
user_data_2 = {
'email': 'test_email_2@testdomain.com',
'email': 'henry@cranecloud.io',
'name': 'Test User 2',
'organisation': 'Makerere',
'password': 'Compl3xPassw0rd',
Expand All @@ -23,7 +23,7 @@ class UserBaseTestCase():
}

admin_data = {
'email': 'test_admin@testdomain.com',
'email': 'admin@cranecloud.io',
'name': 'Test Admin',
'password': 'Compl3xPassw0rd',
'phone_number': '+256777777777',
Expand Down
2 changes: 1 addition & 1 deletion app/tests/user/test_user_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def test_create_user_with_fixture(new_user):
THEN check the email, password and name fields are defined correctly
"""

assert new_user.email == 'test_email@testdomain.com'
assert new_user.email == 'rhodin@cranecloud.io'
assert new_user.password != 'test_password'
assert new_user.name == 'test_name'
assert new_user.verified
Expand Down

0 comments on commit 8974de9

Please sign in to comment.