diff -r 0b171fe8b1bc django/test/simple.py
a
|
b
|
|
124 | 124 | return suite |
125 | 125 | |
126 | 126 | def build_test(label): |
127 | | """Construct a test case a test with the specified label. Label should |
128 | | be of the form model.TestClass or model.TestClass.test_method. Returns |
129 | | an instantiated test or test suite corresponding to the label provided. |
| 127 | """Construct a test case with the specified label. Label should be of the |
| 128 | form model.TestClass or model.TestClass.test_method. Returns an |
| 129 | instantiated test or test suite corresponding to the label provided. |
130 | 130 | |
131 | 131 | """ |
132 | 132 | parts = label.split('.') |
… |
… |
|
271 | 271 | """ |
272 | 272 | self.setup_test_environment() |
273 | 273 | |
| 274 | suite = self.build_suite(test_labels, extra_tests) |
| 275 | |
274 | 276 | old_names = self.setup_databases() |
275 | 277 | |
276 | | suite = self.build_suite(test_labels, extra_tests) |
277 | | |
278 | 278 | result = self.run_suite(suite) |
279 | 279 | |
280 | 280 | self.teardown_databases(old_names) |
diff -r 0b171fe8b1bc docs/topics/testing.txt
a
|
b
|
|
1233 | 1233 | |
1234 | 1234 | #. Performing global pre-test setup. |
1235 | 1235 | |
| 1236 | #. Looking for unit tests and doctests in the ``models.py`` and |
| 1237 | ``tests.py`` files in each installed application. |
| 1238 | |
1236 | 1239 | #. Creating the test databases. |
1237 | 1240 | |
1238 | 1241 | #. Running ``syncdb`` to install models and initial data into the test |
1239 | 1242 | databases. |
1240 | 1243 | |
1241 | | #. Looking for unit tests and doctests in the ``models.py`` and |
1242 | | ``tests.py`` files in each installed application. |
1243 | | |
1244 | 1244 | #. Running the unit tests and doctests that are found. |
1245 | 1245 | |
1246 | 1246 | #. Destroying the test databases. |
diff -r 0b171fe8b1bc tests/modeltests/model_package/tests.py
a
|
b
|
|
37 | 37 | >>> a.sites.count() |
38 | 38 | 1 |
39 | 39 | |
40 | | # Regression for #12248 - Models can exist in the test package, too |
| 40 | # Regression for #12245 - Models can exist in the test package, too |
41 | 41 | |
42 | 42 | >>> ad = Advertisment(customer="Lawrence Journal-World") |
43 | 43 | >>> ad.save() |