Skip to content
Browse files

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

ptone.
  • Loading branch information...
1 parent 4ad9b20 commit b3a124b2150abcafef2c228c9ef142dd1189ba3e @cberner cberner committed Jul 31, 2012
View
0 ...package/B/management/commands/__init__.py → ...scripts/project-A/mypackage/A/__init__.py
File renamed without changes.
View
0 ...ject-B/mypackage/B/management/__init__.py → ...ject-A/mypackage/A/management/__init__.py
File renamed without changes.
View
0 ...ommands/project-B/mypackage/B/__init__.py → ...package/A/management/commands/__init__.py
File renamed without changes.
View
0 ...ackage/A/management/commands/command_A.py → ...ackage/A/management/commands/command_A.py
File renamed without changes.
View
0 ..._commands/project-A/mypackage/__init__.py → ...n_scripts/project-A/mypackage/__init__.py
File renamed without changes.
View
0 ...package/A/management/commands/__init__.py → ...scripts/project-B/mypackage/B/__init__.py
File renamed without changes.
View
0 ...ject-A/mypackage/A/management/__init__.py → ...ject-B/mypackage/B/management/__init__.py
File renamed without changes.
View
0 ...ommands/project-A/mypackage/A/__init__.py → ...package/B/management/commands/__init__.py
File renamed without changes.
View
0 ...ackage/B/management/commands/command_B.py → ...ackage/B/management/commands/command_B.py
File renamed without changes.
View
0 ..._commands/project-B/mypackage/__init__.py → ...n_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)

0 comments on commit b3a124b

Please sign in to comment.
Something went wrong with that request. Please try again.