Commits

Anonymous committed 8140777

test for get_classes()

  • Participants
  • Parent commits 1e39248
  • Branches test-classes

Comments (0)

Files changed (1)

File semanticeditor/tests.py

         c2 = [c for c in classes if c.category is not None and c.category.name == 'Borders']
         assert len(c2) > 0 # Sanity
         self.assertEqual(c2, list(CssClass.objects.filter(category__name='Borders').order_by('verbose_name')))
+
+class TestGetClassesAfterSave(TestCase): 
+   def test_get_classes(self):
+        test_class = CssClass(name="test", verbose_name="Test class")
+        test_class.save()
+        # Should get the class for any template
+        self.assertItemsEqual(
+            get_classes("null.html"),
+            [test_class]
+            )
+