Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

login with no email #409

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions tests/test_before_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@
class TestBeforeLogin(TestCase):

def test_before_login(self):
headers = {"Accept": "text/plain"}

# test_post_bad_login(self):
test_print("test_post_bad_login starting")
bad_login_info = {'email' : 'bademail',
'password' : 'test'}
compare_post_request("/login", bad_login_info, test_name='bad_admin_login')
test_print("test_post_bad_login completed")
test_print("test_not_registered_email starting")
not_registered_email = {'email' : '[email protected]',
'password' : 'test'}
compare_post_request("/login", not_registered_email, test_name='not_registered_email', headers=headers)
test_print("test_not_registered_email completed")

# test_no_username_login(self):
#test_no_username_login(self):
test_print("test_no_username_login starting")
no_email_info = {'password' : 'test'}
compare_post_request("/login", no_email_info, test_name='no_email_login')
compare_post_request("/login", no_email_info, test_name='no_email_login', headers = headers)
test_print("test_no_username_login completed")

# test_post_login_admin(self):
test_print("test_post_login_admin starting")
logininfo = {'email' : '[email protected]',
'password' : 'test'}
compare_post_request("/login", logininfo)
test_print("test_post_login_admin completed")
# test_print("test_post_login_admin starting")
# logininfo = {'email' : '[email protected]',
# 'password' : 'test'}
# compare_post_request("/login", logininfo)
# test_print("test_post_login_admin completed")
6 changes: 3 additions & 3 deletions tests/test_root.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ def test_root():
firstTimeSetup.test_post()

# no commented tests
# from test_before_login import TestBeforeLogin
# testBeforeLogin = TestBeforeLogin()
# testBeforeLogin.test_before_login()
from test_before_login import TestBeforeLogin
testBeforeLogin = TestBeforeLogin()
testBeforeLogin.test_before_login()

# no commented tests
from test_user import TestUser
Expand Down
17 changes: 8 additions & 9 deletions tests/test_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,11 @@ def test_post_register(self):
'password1' : 'test',
'password2' : 'test'
}

compare_post_request("register", data, test_name = "register1", headers = headers, route_parameters = [], files = None, test_type = test_type) #error - account already in use? - FAIL CASE for 1
test_print("test_post_register completed")

test_print("test_post_login starting")
#not registered user
logininfo = {'email' : '[email protected]',
'password' : 'test'}
login_with(logininfo, 0)

#bad password
logininfo = {'email' : '[email protected]',
Expand All @@ -36,10 +33,12 @@ def test_post_register(self):
'password' : 'test'}
login_with(logininfo, 1)
test_print("test_post_login completed")

test_print("test_post_register starting")
compare_get_request("/profile", headers = headers, route_parameters = [], test_type = test_type, comparison_type="json", fields=["name", "username", "email", "affiliation", "graphUri"])

test_print("test_get_profile starting")
compare_get_request("/profile", headers = headers, route_parameters = [], test_type = test_type, comparison_type="json", fields=["name", "username", "email", "affiliation", "graphUri"])
test_print("test_get_profile completed")

test_print("test_post_profile starting")
data={
'name': 'ronnie',
'affiliation' : 'notcovid',
Expand All @@ -49,7 +48,7 @@ def test_post_register(self):
}

compare_post_request("profile", data, test_name = "profile2", headers = headers, route_parameters = [], files = None, test_type = test_type)

test_print("test_post_profile completed")
#compare_get_request("/logout")
# test_print("logout started")
# data={
Expand Down