Commit 14416f61 authored by carlosribas's avatar carlosribas
Browse files

Create basic unit tests

parent 2be20f06
...@@ -2,7 +2,7 @@ from django.test import TestCase ...@@ -2,7 +2,7 @@ from django.test import TestCase
from django.urls import resolve, reverse from django.urls import resolve, reverse
from mock import patch, Mock from mock import patch, Mock
from sequence_search.views import dashboard, show_searches from sequence_search.views import dashboard, sequence_search, show_searches
class SequenceSearchTest(TestCase): class SequenceSearchTest(TestCase):
...@@ -19,6 +19,10 @@ class SequenceSearchTest(TestCase): ...@@ -19,6 +19,10 @@ class SequenceSearchTest(TestCase):
view = resolve('/sequence-search/show-searches') view = resolve('/sequence-search/show-searches')
self.assertEquals(view.func, show_searches) self.assertEquals(view.func, show_searches)
def test_show_searches_status_code(self):
response = self.client.get(reverse('sequence-search-show-searches'))
self.assertEquals(response.status_code, 200)
def test_dashboard_url(self): def test_dashboard_url(self):
view = resolve('/sequence-search/dashboard') view = resolve('/sequence-search/dashboard')
self.assertEquals(view.func, dashboard) self.assertEquals(view.func, dashboard)
...@@ -55,6 +59,10 @@ class SequenceSearchTest(TestCase): ...@@ -55,6 +59,10 @@ class SequenceSearchTest(TestCase):
response = self.client.get(reverse('sequence-search-api')) response = self.client.get(reverse('sequence-search-api'))
self.assertTemplateUsed(response, 'api.html') self.assertTemplateUsed(response, 'api.html')
def test_sequence_search_url(self):
view = resolve('/sequence-search/')
self.assertEquals(view.func, sequence_search)
def test_sequence_search_status_code(self): def test_sequence_search_status_code(self):
response = self.client.get(reverse('sequence-search')) response = self.client.get(reverse('sequence-search'))
self.assertEquals(response.status_code, 200) self.assertEquals(response.status_code, 200)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment