add tests for pageurl / slugurl

This commit is contained in:
Matt Westcott 2014-04-01 15:17:05 +01:00
parent 0666c67716
commit dc6e23ac53
2 changed files with 16 additions and 0 deletions

View file

@ -1,3 +1,4 @@
{% load pageurl %}
<!DOCTYPE HTML>
<html>
<head>
@ -6,5 +7,6 @@
<body>
<h1>{{ self.title }}</h1>
<h2>Event</h2>
<p><a href="{% slugurl 'events' %}">Back to events index</a></p>
</body>
</html>

View file

@ -162,6 +162,20 @@ class TestServeView(TestCase):
self.assertContains(response, '<a href="/events/christmas/">Christmas</a>')
class TestPageUrlTags(TestCase):
fixtures = ['test.json']
def test_pageurl_tag(self):
response = self.client.get('/events/')
self.assertEqual(response.status_code, 200)
self.assertContains(response, '<a href="/events/christmas/">Christmas</a>')
def test_slugurl_tag(self):
response = self.client.get('/events/christmas/')
self.assertEqual(response.status_code, 200)
self.assertContains(response, '<a href="/events/">Back to events index</a>')
class TestPagePermission(TestCase):
fixtures = ['test.json']