aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMuriithi Frederick Muriuki2018-02-19 14:12:59 +0300
committerMuriithi Frederick Muriuki2018-02-19 14:12:59 +0300
commit2035387823ffc87bc2b6a817a06cb3a47aa006a0 (patch)
treee93933eda3351fa47729cb8aae127425388f326c /test
parent85015343fd99885ec00db86b4e3705bcc25e62f1 (diff)
downloadgenenetwork2-2035387823ffc87bc2b6a817a06cb3a47aa006a0.tar.gz
Add more login tests.
Diffstat (limited to 'test')
-rw-r--r--test/requests/test_login_local.py39
1 files changed, 37 insertions, 2 deletions
diff --git a/test/requests/test_login_local.py b/test/requests/test_login_local.py
index bced1ee9..acad45c9 100644
--- a/test/requests/test_login_local.py
+++ b/test/requests/test_login_local.py
@@ -32,12 +32,47 @@ class TestLoginLocal(ParametrizedTest):
"password": "test_password"
}
result = requests.post(self.login_url, data=data)
- print("THE COOKIES? ", result.cookies)
self.assertEqual(
result.url
, self.gn2_url+"/?import_collections=false"
, "Login should have been successful")
-
+
+ def testLoginWithRegisteredUserImportCollectionsTrueAndRememberMeFalse(self):
+ data = {
+ "email_address": "test@user.com",
+ "password": "test_password",
+ "import_collections": "y"
+ }
+ result = requests.post(self.login_url, data=data)
+ self.assertEqual(
+ result.url
+ , self.gn2_url+"/?import_collections=true"
+ , "Login should have been successful")
+
+ def testLoginWithRegisteredUserImportCollectionsFalseAndRememberMeTrue(self):
+ data = {
+ "email_address": "test@user.com",
+ "password": "test_password",
+ "remember_me": "y"
+ }
+ result = requests.post(self.login_url, data=data)
+ self.assertEqual(
+ result.url
+ , self.gn2_url+"/?import_collections=false"
+ , "Login should have been successful")
+
+ def testLoginWithRegisteredUserBothImportCollectionsAndRememberMeTrue(self):
+ data = {
+ "email_address": "test@user.com",
+ "password": "test_password",
+ "remember_me": "y",
+ "import_collections": "y"
+ }
+ result = requests.post(self.login_url, data=data)
+ self.assertEqual(
+ result.url
+ , self.gn2_url+"/?import_collections=true"
+ , "Login should have been successful")
def main(gn2, es):