コード例 #1
0
    def test_get_models_specific(self):
        from .core.models import MockModel

        models = app_loading.haystack_get_models('core.MockModel')
        self.assertIsInstance(models, (list, GeneratorType))
        self.assertListEqual(models, [MockModel])
コード例 #2
0
 def test_hierarchal_app_specific_model(self):
     models = app_loading.haystack_get_models('hierarchal_app_django.HierarchalAppModel')
     self.assertIsInstance(models, (list, GeneratorType))
     self.assertSetEqual(set(str(i._meta) for i in models),
                         set(('hierarchal_app_django.hierarchalappmodel', )))
コード例 #3
0
 def test_get_models_all(self):
     models = app_loading.haystack_get_models('core')
     self.assertIsInstance(models, (list, GeneratorType))