reg/tests.py
author nishanth
Fri, 23 Apr 2010 16:36:40 +0530
changeset 99 cc2ed87ee896
parent 0 30a0f9e20fd4
permissions -rwxr-xr-x
resolved a bug
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
     1
"""
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
     2
This file demonstrates two different styles of tests (one doctest and one
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
     3
unittest). These will both pass when you run "manage.py test".
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
     4
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
     5
Replace these with more appropriate tests for your application.
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
     6
"""
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
     7
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
     8
from django.test import TestCase
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
     9
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    10
class SimpleTest(TestCase):
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    11
    def test_basic_addition(self):
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    12
        """
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    13
        Tests that 1 + 1 always equals 2.
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    14
        """
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    15
        self.failUnlessEqual(1 + 1, 2)
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    16
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    17
__test__ = {"doctest": """
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    18
Another way to test that 1 + 1 is equal to 2.
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    19
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    20
>>> 1 + 1 == 2
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    21
True
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    22
"""}
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    23