author | Nishanth Amuluru <nishanth@fossee.in> |
Tue, 11 Jan 2011 11:30:14 +0530 | |
changeset 137 | 40f1ef7a46d8 |
parent 69 | c6bca38c1cbf |
permissions | -rwxr-xr-x |
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 |