reg/tests.py
author nishanth
Tue, 13 Apr 2010 14:50:48 +0530
changeset 26 9d18daf5277f
parent 0 30a0f9e20fd4
permissions -rw-r--r--
now the "you must register" link appears on view event page .
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