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