Tested for Django 1.7-1.11
[django-migdal.git] / example_project / tests.py
diff --git a/example_project/tests.py b/example_project/tests.py
new file mode 100644 (file)
index 0000000..e4b4e4e
--- /dev/null
@@ -0,0 +1,29 @@
+from django.test import TestCase
+from migdal.models import Entry
+
+
+class MigdalTests(TestCase):
+    def test_x(self):
+        Entry.objects.create(
+                type='info', author='An author',
+                published_pl=True, title_pl='An info entry', slug_pl='test1',
+                body_pl='**Test text**',
+            )
+        Entry.objects.create(
+                type='blog', author='An author',
+                published_pl=True, title_pl='A blog entry', slug_pl='test2',
+                body_pl='**Test blog text**',
+            )
+
+
+        response = self.client.get('/')
+        self.assertContains(response, 'A blog entry')
+        self.assertNotContains(response, 'An info entry')
+
+
+
+        response = self.client.get('/info/')
+        self.assertContains(response, 'An info entry')
+
+        response = self.client.get('/info/test1/')
+        self.assertContains(response, '<b>Test text</b>')