quiz/tests.py
author nishanth
Wed, 21 Apr 2010 19:39:19 +0530
changeset 36 9e0d6aecf269
parent 12 81cd0140a0f2
permissions -rw-r--r--
added "return to admin page" link in open_feedback page
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12
81cd0140a0f2 created the register user functionality.
nishanth
parents:
diff changeset
     1
"""
81cd0140a0f2 created the register user functionality.
nishanth
parents:
diff changeset
     2
This file demonstrates two different styles of tests (one doctest and one
81cd0140a0f2 created the register user functionality.
nishanth
parents:
diff changeset
     3
unittest). These will both pass when you run "manage.py test".
81cd0140a0f2 created the register user functionality.
nishanth
parents:
diff changeset
     4
81cd0140a0f2 created the register user functionality.
nishanth
parents:
diff changeset
     5
Replace these with more appropriate tests for your application.
81cd0140a0f2 created the register user functionality.
nishanth
parents:
diff changeset
     6
"""
81cd0140a0f2 created the register user functionality.
nishanth
parents:
diff changeset
     7
81cd0140a0f2 created the register user functionality.
nishanth
parents:
diff changeset
     8
from django.test import TestCase
81cd0140a0f2 created the register user functionality.
nishanth
parents:
diff changeset
     9
81cd0140a0f2 created the register user functionality.
nishanth
parents:
diff changeset
    10
class SimpleTest(TestCase):
81cd0140a0f2 created the register user functionality.
nishanth
parents:
diff changeset
    11
    def test_basic_addition(self):
81cd0140a0f2 created the register user functionality.
nishanth
parents:
diff changeset
    12
        """
81cd0140a0f2 created the register user functionality.
nishanth
parents:
diff changeset
    13
        Tests that 1 + 1 always equals 2.
81cd0140a0f2 created the register user functionality.
nishanth
parents:
diff changeset
    14
        """
81cd0140a0f2 created the register user functionality.
nishanth
parents:
diff changeset
    15
        self.failUnlessEqual(1 + 1, 2)
81cd0140a0f2 created the register user functionality.
nishanth
parents:
diff changeset
    16
81cd0140a0f2 created the register user functionality.
nishanth
parents:
diff changeset
    17
__test__ = {"doctest": """
81cd0140a0f2 created the register user functionality.
nishanth
parents:
diff changeset
    18
Another way to test that 1 + 1 is equal to 2.
81cd0140a0f2 created the register user functionality.
nishanth
parents:
diff changeset
    19
81cd0140a0f2 created the register user functionality.
nishanth
parents:
diff changeset
    20
>>> 1 + 1 == 2
81cd0140a0f2 created the register user functionality.
nishanth
parents:
diff changeset
    21
True
81cd0140a0f2 created the register user functionality.
nishanth
parents:
diff changeset
    22
"""}
81cd0140a0f2 created the register user functionality.
nishanth
parents:
diff changeset
    23