Tested for Django 1.7-1.11
[django-migdal.git] / example_project / tests.py
1 from django.test import TestCase
2 from migdal.models import Entry
3
4
5 class MigdalTests(TestCase):
6     def test_x(self):
7         Entry.objects.create(
8                 type='info', author='An author',
9                 published_pl=True, title_pl='An info entry', slug_pl='test1',
10                 body_pl='**Test text**',
11             )
12         Entry.objects.create(
13                 type='blog', author='An author',
14                 published_pl=True, title_pl='A blog entry', slug_pl='test2',
15                 body_pl='**Test blog text**',
16             )
17
18
19         response = self.client.get('/')
20         self.assertContains(response, 'A blog entry')
21         self.assertNotContains(response, 'An info entry')
22
23
24
25         response = self.client.get('/info/')
26         self.assertContains(response, 'An info entry')
27
28         response = self.client.get('/info/test1/')
29         self.assertContains(response, '<b>Test text</b>')