Ticket #17364: testing.txt.diff
File testing.txt.diff, 1.3 KB (added by , 13 years ago) |
---|
-
docs/topics/testing.txt
85 85 :mod:`django.utils.unittest` module alias. If you are using Python 86 86 2.7, or you have installed unittest2 locally, Django will map the 87 87 alias to the installed version of the unittest library. Otherwise, 88 Django will use it 's own bundled version of unittest2.88 Django will use its own bundled version of unittest2. 89 89 90 90 To use this alias, simply use:: 91 91 … … 120 120 self.lion = Animal.objects.create(name="lion", sound="roar") 121 121 self.cat = Animal.objects.create(name="cat", sound="meow") 122 122 123 def test Speaking(self):123 def test_animals_can_speak(self): 124 124 self.assertEqual(self.lion.speak(), 'The lion says "roar"') 125 125 self.assertEqual(self.cat.speak(), 'The cat says "meow"') 126 126 … … 288 288 method inside a test case, add the name of the test method to the 289 289 label:: 290 290 291 $ ./manage.py test animals.AnimalTestCase.test FluffyAnimals291 $ ./manage.py test animals.AnimalTestCase.test_animals_can_speak 292 292 293 293 .. versionadded:: 1.2 294 294 The ability to select individual doctests was added.