Update by natay on Mon Nov  5 13:55:17 EST 2018 from Admins-MacBook-Air.local
@@ -3,6 +3,7 @@ from django.test import TestCase
from django.test import Client
from biostar.engine import auth
from biostar.engine import models
+from django.conf import settings
from django.urls import reverse
@@ -33,7 +34,7 @@ class SiteNavigation(TestCase):
c = Client()
c.login(username="test", email='test@test.com', password='testing')
for url in urls:
- resp = c.get(url, data={"q":"test"})
+ resp = c.get(url, data={"q": "test", 'k': settings.API_KEY})
code = resp.status_code
if code not in codes:
# We already know it is an error.
@@ -45,6 +46,13 @@ class SiteNavigation(TestCase):
def test_public_pages(self):
"Checking public pages"
+ api_urls = [
+
+ reverse('api_list'),
+ reverse('api_json', kwargs=self.analysis_params),
+ reverse('api_template', kwargs=self.analysis_params)
+ ]
+
urls = [
reverse('index'),
reverse('logout'),
@@ -71,6 +79,7 @@ class SiteNavigation(TestCase):
]
self.visit_urls(urls, [200])
+ self.visit_urls(api_urls, [200])
def test_page_redirect(self):
"Testing that a redirect occurs for some pages"
