Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

tests.py 514B

1234567891011121314151617181920212223
  1. """
  2. This file demonstrates two different styles of tests (one doctest and one
  3. unittest). These will both pass when you run "manage.py test".
  4. Replace these with more appropriate tests for your application.
  5. """
  6. from django.test import TestCase
  7. class SimpleTest(TestCase):
  8. def test_basic_addition(self):
  9. """
  10. Tests that 1 + 1 always equals 2.
  11. """
  12. self.failUnlessEqual(1 + 1, 2)
  13. __test__ = {"doctest": """
  14. Another way to test that 1 + 1 is equal to 2.
  15. >>> 1 + 1 == 2
  16. True
  17. """}