pytask/taskapp/tests.py
author Madhusudan.C.S <madhusudancs@gmail.com>
Tue, 01 Feb 2011 15:02:52 +0530
changeset 546 6393b77c3c68
parent 307 c6bca38c1cbf
permissions -rwxr-xr-x
Change the textbook list templatetag to task list template tag.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
296
f82fb4914cdf Added an app for tasks and stuff
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
     1
"""
f82fb4914cdf Added an app for tasks and stuff
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
     2
This file demonstrates two different styles of tests (one doctest and one
f82fb4914cdf Added an app for tasks and stuff
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
     3
unittest). These will both pass when you run "manage.py test".
f82fb4914cdf Added an app for tasks and stuff
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
     4
f82fb4914cdf Added an app for tasks and stuff
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
     5
Replace these with more appropriate tests for your application.
f82fb4914cdf Added an app for tasks and stuff
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
     6
"""
f82fb4914cdf Added an app for tasks and stuff
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
     7
f82fb4914cdf Added an app for tasks and stuff
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
     8
from django.test import TestCase
f82fb4914cdf Added an app for tasks and stuff
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
     9
f82fb4914cdf Added an app for tasks and stuff
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    10
class SimpleTest(TestCase):
f82fb4914cdf Added an app for tasks and stuff
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    11
    def test_basic_addition(self):
f82fb4914cdf Added an app for tasks and stuff
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    12
        """
f82fb4914cdf Added an app for tasks and stuff
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    13
        Tests that 1 + 1 always equals 2.
f82fb4914cdf Added an app for tasks and stuff
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    14
        """
f82fb4914cdf Added an app for tasks and stuff
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    15
        self.failUnlessEqual(1 + 1, 2)
f82fb4914cdf Added an app for tasks and stuff
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    16
f82fb4914cdf Added an app for tasks and stuff
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    17
__test__ = {"doctest": """
f82fb4914cdf Added an app for tasks and stuff
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    18
Another way to test that 1 + 1 is equal to 2.
f82fb4914cdf Added an app for tasks and stuff
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    19
f82fb4914cdf Added an app for tasks and stuff
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    20
>>> 1 + 1 == 2
f82fb4914cdf Added an app for tasks and stuff
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    21
True
f82fb4914cdf Added an app for tasks and stuff
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    22
"""}
f82fb4914cdf Added an app for tasks and stuff
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    23