def test_get_containing_app_data_succeed(self): self.assertEqual(compat.get_containing_app_data('django.contrib.admin.views'), ('admin', 'django.contrib.admin')) self.assertEqual(compat.get_containing_app_data('django.contrib.auth.urls'), ('auth', 'django.contrib.auth')) self.assertEqual(compat.get_containing_app_data('viewflow.flows'), ('viewflow', 'viewflow'))
def test_get_containing_app_data_none_on_missing(self): self.assertEqual(compat.get_containing_app_data('unknown.module'), (None, None))
def test_get_containing_app_data_bug112(self): """ Application models are located in a module that consists of multiple files """ self.assertEqual(compat.get_containing_app_data('tests.models'), ('tests', 'tests'))