Loading tests/test_client_override/tests.pydeleted 100644 → 0 +0 −21 Original line number Diff line number Diff line from django.utils import unittest def suite(): """ Validate that you can override the default test suite Define a suite that deliberately ignores a test defined in this module. """ testSuite = unittest.TestSuite() testSuite.addTest(SampleTests('testGoodStuff')) return testSuite class SampleTests(unittest.TestCase): def testGoodStuff(self): pass def testBadStuff(self): self.fail("This test shouldn't run") tests/test_client_override/__init__.py→tests/test_suite_override/__init__.py +0 −0 File moved. tests/test_client_override/models.py→tests/test_suite_override/models.py +0 −0 File moved. tests/test_suite_override/tests.py 0 → 100644 +34 −0 Original line number Diff line number Diff line from django.db.models import get_app from django.test.simple import build_suite from django.utils import unittest def suite(): testSuite = unittest.TestSuite() testSuite.addTest(SuiteOverrideTest('test_suite_override')) return testSuite class SuiteOverrideTest(unittest.TestCase): def test_suite_override(self): """ Validate that you can define a custom suite when running tests with ``django.test.simple.DjangoTestSuiteRunner`` (which builds up a test suite using ``build_suite``). """ app = get_app("test_suite_override") suite = build_suite(app) self.assertEqual(suite.countTestCases(), 1) class SampleTests(unittest.TestCase): """These tests should not be discovered, due to the custom suite.""" def test_one(self): pass def test_two(self): pass def test_three(self): pass Loading
tests/test_client_override/tests.pydeleted 100644 → 0 +0 −21 Original line number Diff line number Diff line from django.utils import unittest def suite(): """ Validate that you can override the default test suite Define a suite that deliberately ignores a test defined in this module. """ testSuite = unittest.TestSuite() testSuite.addTest(SampleTests('testGoodStuff')) return testSuite class SampleTests(unittest.TestCase): def testGoodStuff(self): pass def testBadStuff(self): self.fail("This test shouldn't run")
tests/test_suite_override/tests.py 0 → 100644 +34 −0 Original line number Diff line number Diff line from django.db.models import get_app from django.test.simple import build_suite from django.utils import unittest def suite(): testSuite = unittest.TestSuite() testSuite.addTest(SuiteOverrideTest('test_suite_override')) return testSuite class SuiteOverrideTest(unittest.TestCase): def test_suite_override(self): """ Validate that you can define a custom suite when running tests with ``django.test.simple.DjangoTestSuiteRunner`` (which builds up a test suite using ``build_suite``). """ app = get_app("test_suite_override") suite = build_suite(app) self.assertEqual(suite.countTestCases(), 1) class SampleTests(unittest.TestCase): """These tests should not be discovered, due to the custom suite.""" def test_one(self): pass def test_two(self): pass def test_three(self): pass