pytask/profile/tests.py
author Nishanth Amuluru <nishanth@fossee.in>
Wed, 12 Jan 2011 00:22:27 +0530
changeset 149 32dd15eaf9d0
parent 69 c6bca38c1cbf
permissions -rwxr-xr-x
fixed a bug where guest users were not able to view the page correctly
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
58
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