Пример #1
0
 def test_category(self):
     """Adding parents and childs.
     """
     root_category = Category(
         name='root', slug='root')
     root_category.save()
     child_category = Category(
         name='child',
         slug='child',
         parent=root_category)
     child_category.save()
     children = root_category.get_children()
     self.assertEquals(len(children), 1)
     self.assertEquals(str(children[0]), str(child_category))