예제 #1
0
 def setUp(self):
     super(CTTDummyRebuildTest, self).setUp()
     tpms_before = Node._tpm.objects.count()
     Node._tpm.objects.all().delete()
     self.assertNotEqual(tpms_before, Node._tpm.objects.count())
     Node._rebuild_tree()
     self.assertEqual(tpms_before, Node._tpm.objects.count())
예제 #2
0
파일: tests.py 프로젝트: uruz/django-ctt
 def setUp(self):
     super(CTTDummyRebuildTest, self).setUp()
     tpms_before = Node._tpm.objects.count()
     Node._tpm.objects.all().delete()
     self.assertNotEqual(tpms_before, Node._tpm.objects.count())
     Node._rebuild_tree()
     self.assertEqual(tpms_before, Node._tpm.objects.count())
예제 #3
0
    def setUp(self):
        super(CTTDummyRebuildQSTest, self).setUp()

        tpms_before = Node._tpm.objects.count()

        Node._tpm.objects.filter(
            descendant__in=Node.objects.filter(
                name__in=['1', '2', '3', '4'])).\
            delete()
        self.assertNotEqual(tpms_before, Node._tpm.objects.count())

        Node._rebuild_qs(Node.objects.filter(name='2'))

        self.assertEqual(tpms_before, Node._tpm.objects.count())
예제 #4
0
파일: tests.py 프로젝트: uruz/django-ctt
    def setUp(self):
        super(CTTDummyRebuildQSTest, self).setUp()

        tpms_before = Node._tpm.objects.count()

        Node._tpm.objects.filter(
            descendant__in=Node.objects.filter(
                name__in=['1', '2', '3', '4'])).\
            delete()
        self.assertNotEqual(tpms_before, Node._tpm.objects.count())

        Node._rebuild_qs(Node.objects.filter(name='2'))

        self.assertEqual(tpms_before, Node._tpm.objects.count())