profile/tests.py
author Nishanth Amuluru <nishanth@fossee.in>
Fri, 07 Jan 2011 09:22:40 +0530
changeset 16 5c000bf6f241
parent 3 479cbf5c822a
permissions -rwxr-xr-x
Fixed a few typos
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3
479cbf5c822a Added an app called profile to manage user profiles
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
     1
"""
479cbf5c822a Added an app called profile to manage user profiles
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
     2
This file demonstrates two different styles of tests (one doctest and one
479cbf5c822a Added an app called profile to manage user profiles
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
     3
unittest). These will both pass when you run "manage.py test".
479cbf5c822a Added an app called profile to manage user profiles
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
     4
479cbf5c822a Added an app called profile to manage user profiles
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
     5
Replace these with more appropriate tests for your application.
479cbf5c822a Added an app called profile to manage user profiles
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
     6
"""
479cbf5c822a Added an app called profile to manage user profiles
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
     7
479cbf5c822a Added an app called profile to manage user profiles
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
     8
from django.test import TestCase
479cbf5c822a Added an app called profile to manage user profiles
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
     9
479cbf5c822a Added an app called profile to manage user profiles
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    10
class SimpleTest(TestCase):
479cbf5c822a Added an app called profile to manage user profiles
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    11
    def test_basic_addition(self):
479cbf5c822a Added an app called profile to manage user profiles
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    12
        """
479cbf5c822a Added an app called profile to manage user profiles
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    13
        Tests that 1 + 1 always equals 2.
479cbf5c822a Added an app called profile to manage user profiles
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    14
        """
479cbf5c822a Added an app called profile to manage user profiles
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    15
        self.failUnlessEqual(1 + 1, 2)
479cbf5c822a Added an app called profile to manage user profiles
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    16
479cbf5c822a Added an app called profile to manage user profiles
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    17
__test__ = {"doctest": """
479cbf5c822a Added an app called profile to manage user profiles
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    18
Another way to test that 1 + 1 is equal to 2.
479cbf5c822a Added an app called profile to manage user profiles
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    19
479cbf5c822a Added an app called profile to manage user profiles
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    20
>>> 1 + 1 == 2
479cbf5c822a Added an app called profile to manage user profiles
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    21
True
479cbf5c822a Added an app called profile to manage user profiles
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    22
"""}
479cbf5c822a Added an app called profile to manage user profiles
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    23