def test_import_project_sitetree_modules(): from sitetree import settings from sitetree.models import Tree from sitetree.utils import get_model_class cls = get_model_class('MODEL_TREE') assert cls is Tree settings.MODEL_TREE = 'nowhere.Model' with pytest.raises(ImproperlyConfigured): get_model_class('MODEL_TREE')
def test_import_project_sitetree_modules(self): cls = get_model_class('MODEL_TREE') self.assertIs(cls, Tree)