aboutsummaryrefslogtreecommitdiff
path: root/test/requests/test_login_github.py
diff options
context:
space:
mode:
authorMuriithi Frederick Muriuki2018-02-23 18:11:33 +0300
committerMuriithi Frederick Muriuki2018-02-23 18:11:33 +0300
commit1f591baa129a7a42d6c0cadf73441274c8e373d3 (patch)
treef0164161a34b94feb031ddee4d352ea4b80fe245 /test/requests/test_login_github.py
parent1ee48887d93cace2d1b00b2f1adc9a6407fdb882 (diff)
downloadgenenetwork2-1f591baa129a7a42d6c0cadf73441274c8e373d3.tar.gz
Add tests to check that the UI is setup correctly
* Check that the links for OAuth2 logins via ORCID and GitHub are setup correctly.
Diffstat (limited to 'test/requests/test_login_github.py')
-rw-r--r--test/requests/test_login_github.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/requests/test_login_github.py b/test/requests/test_login_github.py
index 15bf18ae..1bf4f695 100644
--- a/test/requests/test_login_github.py
+++ b/test/requests/test_login_github.py
@@ -1,6 +1,7 @@
import uuid
import requests
from time import sleep
+from wqflask import app
from parameterized import parameterized
from parametrized_test import ParametrizedTest
@@ -29,6 +30,12 @@ class TestLoginGithub(ParametrizedTest):
super(TestLoginGithub, self).tearDown()
self.es.delete(index="users", doc_type="local", id=uid)
+ def testLoginUrl(self):
+ login_button_text = '<a href="https://github.com/login/oauth/authorize?client_id=' + app.config.get("GITHUB_CLIENT_ID") + '&amp;client_secret=' + app.config.get("GITHUB_CLIENT_SECRET") + '" title="Login with GitHub" class="btn btn-info btn-group">Login with Github</a>'
+ result = requests.get(self.gn2_url+"/n/login")
+ index = result.content.find(login_button_text)
+ self.assertTrue(index >= 0, "Should have found `Login with Github` button")
+
@parameterized.expand([
("1234", login_link_text, "Login should have failed with non-existing user")
, (uid, logout_link_text, "Login should have been successful with existing user")