sdi/tests.py
author anoop
Sun, 08 Aug 2010 13:53:17 +0530
branchanoop
changeset 227 1a6c97e02355
parent 4 ac7eaa878437
permissions -rw-r--r--
updated schedule.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
     1
"""
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
     2
This file demonstrates two different styles of tests (one doctest and one
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
     3
unittest). These will both pass when you run "manage.py test".
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
     4
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
     5
Replace these with more appropriate tests for your application.
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
     6
"""
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
     7
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
     8
from django.test import TestCase
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
     9
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
    10
class SimpleTest(TestCase):
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
    11
    def test_basic_addition(self):
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
    12
        """
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
    13
        Tests that 1 + 1 always equals 2.
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
    14
        """
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
    15
        self.failUnlessEqual(1 + 1, 2)
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
    16
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
    17
__test__ = {"doctest": """
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
    18
Another way to test that 1 + 1 is equal to 2.
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
    19
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
    20
>>> 1 + 1 == 2
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
    21
True
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
    22
"""}
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
    23