Exemplo n.º 1
0
    def test_mongomanager_instances_on_not_document_subclasses_are_ignored(self):
        from catalog.mongomodels import _managers_autodiscover
        mod = self._makeCase3()

        self.assertEqual(_managers_autodiscover(base=mod), [])
Exemplo n.º 2
0
    def test_list_elements_are_mongomanager_instances(self):
        from catalog.mongomodels import _managers_autodiscover, MongoManager
        mod = self._makeCase1()

        self.assertTrue(isinstance(_managers_autodiscover(base=mod)[0],
            MongoManager))
Exemplo n.º 3
0
    def test_instances_different_than_mongomanager_are_ignored(self):
        from catalog.mongomodels import _managers_autodiscover
        mod = self._makeCase2()

        self.assertEqual(_managers_autodiscover(base=mod), [])
Exemplo n.º 4
0
    def test_mongomanager_instances_on_document_subclasses_are_identified(self):
        from catalog.mongomodels import _managers_autodiscover
        mod = self._makeCase1()

        self.assertEqual(_managers_autodiscover(base=mod), [mod.Foo.objects])