feedback/tests.py
author nishanth
Thu, 01 Jul 2010 16:01:48 +0530
changeset 78 2264a51fc9cf
parent 1 5d921672ef41
permissions -rw-r--r--
created the view to display questions
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
5d921672ef41 added db to settings and made an app called feedback
nishanth
parents:
diff changeset
     1
"""
5d921672ef41 added db to settings and made an app called feedback
nishanth
parents:
diff changeset
     2
This file demonstrates two different styles of tests (one doctest and one
5d921672ef41 added db to settings and made an app called feedback
nishanth
parents:
diff changeset
     3
unittest). These will both pass when you run "manage.py test".
5d921672ef41 added db to settings and made an app called feedback
nishanth
parents:
diff changeset
     4
5d921672ef41 added db to settings and made an app called feedback
nishanth
parents:
diff changeset
     5
Replace these with more appropriate tests for your application.
5d921672ef41 added db to settings and made an app called feedback
nishanth
parents:
diff changeset
     6
"""
5d921672ef41 added db to settings and made an app called feedback
nishanth
parents:
diff changeset
     7
5d921672ef41 added db to settings and made an app called feedback
nishanth
parents:
diff changeset
     8
from django.test import TestCase
5d921672ef41 added db to settings and made an app called feedback
nishanth
parents:
diff changeset
     9
5d921672ef41 added db to settings and made an app called feedback
nishanth
parents:
diff changeset
    10
class SimpleTest(TestCase):
5d921672ef41 added db to settings and made an app called feedback
nishanth
parents:
diff changeset
    11
    def test_basic_addition(self):
5d921672ef41 added db to settings and made an app called feedback
nishanth
parents:
diff changeset
    12
        """
5d921672ef41 added db to settings and made an app called feedback
nishanth
parents:
diff changeset
    13
        Tests that 1 + 1 always equals 2.
5d921672ef41 added db to settings and made an app called feedback
nishanth
parents:
diff changeset
    14
        """
5d921672ef41 added db to settings and made an app called feedback
nishanth
parents:
diff changeset
    15
        self.failUnlessEqual(1 + 1, 2)
5d921672ef41 added db to settings and made an app called feedback
nishanth
parents:
diff changeset
    16
5d921672ef41 added db to settings and made an app called feedback
nishanth
parents:
diff changeset
    17
__test__ = {"doctest": """
5d921672ef41 added db to settings and made an app called feedback
nishanth
parents:
diff changeset
    18
Another way to test that 1 + 1 is equal to 2.
5d921672ef41 added db to settings and made an app called feedback
nishanth
parents:
diff changeset
    19
5d921672ef41 added db to settings and made an app called feedback
nishanth
parents:
diff changeset
    20
>>> 1 + 1 == 2
5d921672ef41 added db to settings and made an app called feedback
nishanth
parents:
diff changeset
    21
True
5d921672ef41 added db to settings and made an app called feedback
nishanth
parents:
diff changeset
    22
"""}
5d921672ef41 added db to settings and made an app called feedback
nishanth
parents:
diff changeset
    23