MCPcopy
hub / github.com/django/django / test_multiple_paths

Method test_multiple_paths

tests/apps/tests.py:550–562  ·  view source on GitHub ↗

A Py3.3+ namespace package with multiple locations cannot be an app. (Because then we wouldn't know where to load its templates, static assets, etc. from.)

(self)

Source from the content-addressed store, hash-verified

548 self.assertEqual(app_config.path, self.app_path)
549
550 def test_multiple_paths(self):
551 """
552 A Py3.3+ namespace package with multiple locations cannot be an app.
553
554 (Because then we wouldn't know where to load its templates, static
555 assets, etc. from.)
556 """
557 # Temporarily add two directories to sys.path that both contain
558 # components of the "nsapp" package.
559 with extend_sys_path(self.base_location, self.other_location):
560 with self.assertRaises(ImproperlyConfigured):
561 with self.settings(INSTALLED_APPS=["nsapp"]):
562 pass
563
564 def test_multiple_paths_explicit_path(self):
565 """

Callers

nothing calls this directly

Calls 2

extend_sys_pathFunction · 0.90
settingsMethod · 0.45

Tested by

no test coverage detected