summaryrefslogtreecommitdiffstats
path: root/todolists
diff options
context:
space:
mode:
authorJelle van der Waa <jelle@vdwaa.nl>2018-03-25 19:18:46 +0200
committerJelle van der Waa <jelle@vdwaa.nl>2018-03-25 19:18:46 +0200
commit692d80d71e07a2d88199c9dd842779ef91582723 (patch)
tree893947b23602e8156408994a3868156ab2d69349 /todolists
parentd8977b24f5eef6c1a231f56d48cf0e49e3337ec1 (diff)
downloadarchweb-692d80d71e07a2d88199c9dd842779ef91582723.tar.gz
archweb-692d80d71e07a2d88199c9dd842779ef91582723.zip
todolists: Add test for overview and detail page
Diffstat (limited to 'todolists')
-rw-r--r--todolists/tests/test_views.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/todolists/tests/test_views.py b/todolists/tests/test_views.py
new file mode 100644
index 00000000..cb1a245b
--- /dev/null
+++ b/todolists/tests/test_views.py
@@ -0,0 +1,29 @@
+from django.contrib.auth.models import User
+from django.test import TestCase
+
+
+from todolists.models import Todolist
+
+
+class TestTodolist(TestCase):
+ fixtures = ['main/fixtures/arches.json', 'main/fixtures/repos.json',
+ 'main/fixtures/package.json']
+
+ def setUp(self):
+ self.user = User.objects.create(username="joeuser", first_name="Joe",
+ last_name="User", email="user1@example.com")
+ self.todolist = Todolist.objects.create(name='Boost rebuild',
+ description='Boost 1.66 rebuid',
+ creator=self.user,
+ slug='boost-rebuild',
+ raw='linux')
+
+ def test_todolist_overview(self):
+ response = self.client.get('/todo/')
+ self.assertEqual(response.status_code, 200)
+ self.assertIn(self.todolist.name, response.content)
+
+ def test_todolist_detail(self):
+ response = self.client.get(self.todolist.get_absolute_url())
+ self.assertEqual(response.status_code, 200)
+ self.assertIn(self.todolist.name, response.content)