Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Move unit test for ticket #18685 to admin_scripts tests, as suggested by

ptone.
  • Loading branch information...
commit b3a124b2150abcafef2c228c9ef142dd1189ba3e 1 parent 4ad9b20
@cberner cberner authored
Showing with 17 additions and 22 deletions.
  1. 0  ..._commands/project-B/mypackage/B/management/commands → admin_scripts/project-A/mypackage/A}/__init__.py
  2. 0  ...anagement_commands/project-B/mypackage/B → admin_scripts/project-A/mypackage/A}/management/__init__.py
  3. 0  ..._commands/project-B/mypackage/B → admin_scripts/project-A/mypackage/A/management/commands}/__init__.py
  4. 0  ...siontests/{management_commands → admin_scripts}/project-A/mypackage/A/management/commands/command_A.py
  5. 0  tests/regressiontests/{management_commands → admin_scripts}/project-A/mypackage/__init__.py
  6. 0  ..._commands/project-A/mypackage/A/management/commands → admin_scripts/project-B/mypackage/B}/__init__.py
  7. 0  ...anagement_commands/project-A/mypackage/A → admin_scripts/project-B/mypackage/B}/management/__init__.py
  8. 0  ..._commands/project-A/mypackage/A → admin_scripts/project-B/mypackage/B/management/commands}/__init__.py
  9. 0  ...siontests/{management_commands → admin_scripts}/project-B/mypackage/B/management/commands/command_B.py
  10. 0  tests/regressiontests/{management_commands → admin_scripts}/project-B/mypackage/__init__.py
  11. +17 −0 tests/regressiontests/admin_scripts/tests.py
  12. 0  tests/regressiontests/management_commands/__init__.py
  13. 0  tests/regressiontests/management_commands/models.py
  14. +0 −22 tests/regressiontests/management_commands/tests.py
View
0  ...ect-B/mypackage/B/management/commands/__init__.py → ...s/admin_scripts/project-A/mypackage/A/__init__.py
File renamed without changes
View
0  ...ands/project-B/mypackage/B/management/__init__.py → ...ipts/project-A/mypackage/A/management/__init__.py
File renamed without changes
View
0  ...gement_commands/project-B/mypackage/B/__init__.py → ...ect-A/mypackage/A/management/commands/__init__.py
File renamed without changes
View
0  ...ct-A/mypackage/A/management/commands/command_A.py → ...ct-A/mypackage/A/management/commands/command_A.py
File renamed without changes
View
0  ...nagement_commands/project-A/mypackage/__init__.py → ...sts/admin_scripts/project-A/mypackage/__init__.py
File renamed without changes
View
0  ...ect-A/mypackage/A/management/commands/__init__.py → ...s/admin_scripts/project-B/mypackage/B/__init__.py
File renamed without changes
View
0  ...ands/project-A/mypackage/A/management/__init__.py → ...ipts/project-B/mypackage/B/management/__init__.py
File renamed without changes
View
0  ...gement_commands/project-A/mypackage/A/__init__.py → ...ect-B/mypackage/B/management/commands/__init__.py
File renamed without changes
View
0  ...ct-B/mypackage/B/management/commands/command_B.py → ...ct-B/mypackage/B/management/commands/command_B.py
File renamed without changes
View
0  ...nagement_commands/project-B/mypackage/__init__.py → ...sts/admin_scripts/project-B/mypackage/__init__.py
File renamed without changes
View
17 tests/regressiontests/admin_scripts/tests.py
@@ -17,6 +17,7 @@
from django.test.simple import DjangoTestSuiteRunner
from django.utils import unittest
from django.test import LiveServerTestCase
+from django.core.management import find_management_module
test_dir = os.path.dirname(os.path.dirname(__file__))
@@ -1093,6 +1094,22 @@ def test_liveserver(self):
os.environ['DJANGO_LIVE_TEST_SERVER_ADDRESS'] = old_address
else:
del os.environ['DJANGO_LIVE_TEST_SERVER_ADDRESS']
+
+ def test_modules_from_different_setuptools_packages(self):
+ """Test for ticket 18685. Check that multiple modules in the same package,
+ installed from different setuptools packages, load their management commands
+ correctly.
+ """
+
+ #Add the package directories to the sys path, like setuptools would do,
+ #when running the 'develop' command via an egg-link
+ sys.path.append(os.path.join(os.path.dirname(__file__), "project-A"))
+ sys.path.append(os.path.join(os.path.dirname(__file__), "project-B"))
+
+ module_A_path = find_management_module("mypackage.A")
+ self.assertTrue(module_A_path.endswith("project-A/mypackage/A/management"), module_A_path)
+ module_B_path = find_management_module("mypackage.B")
+ self.assertTrue(module_B_path.endswith("project-B/mypackage/B/management"), module_B_path)
class ManageRunserver(AdminScriptTestCase):
View
0  tests/regressiontests/management_commands/__init__.py
No changes.
View
0  tests/regressiontests/management_commands/models.py
No changes.
View
22 tests/regressiontests/management_commands/tests.py
@@ -1,22 +0,0 @@
-from django.utils import unittest
-from django.core.management import find_management_module
-import sys
-import os
-
-class ManagementCommandTest(unittest.TestCase):
-
- def test_modules_from_different_setuptools_packages(self):
- """Test for ticket 18685. Check that multiple modules in the same package,
- installed from different setuptools packages, load their management commands
- correctly.
- """
-
- #Add the package directories to the sys path, like setuptools would do,
- #when running the 'develop' command via an egg-link
- sys.path.append(os.path.join(os.path.dirname(__file__), "project-A"))
- sys.path.append(os.path.join(os.path.dirname(__file__), "project-B"))
-
- module_A_path = find_management_module("mypackage.A")
- self.assertTrue(module_A_path.endswith("project-A/mypackage/A/management"), module_A_path)
- module_B_path = find_management_module("mypackage.B")
- self.assertTrue(module_B_path.endswith("project-B/mypackage/B/management"), module_B_path)
Please sign in to comment.
Something went wrong with that request. Please try again.