Mercurial > agora
annotate apps/snippet/tests.py @ 2:3cef0d445036
Start actual app structure
author | Jordi Gutiérrez Hermoso <jordigh@gmail.com> |
---|---|
date | Fri, 25 Jun 2010 10:03:51 -0500 |
parents | |
children |
rev | line source |
---|---|
2
3cef0d445036
Start actual app structure
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff
changeset
|
1 """ |
3cef0d445036
Start actual app structure
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff
changeset
|
2 This file demonstrates two different styles of tests (one doctest and one |
3cef0d445036
Start actual app structure
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff
changeset
|
3 unittest). These will both pass when you run "manage.py test". |
3cef0d445036
Start actual app structure
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff
changeset
|
4 |
3cef0d445036
Start actual app structure
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff
changeset
|
5 Replace these with more appropriate tests for your application. |
3cef0d445036
Start actual app structure
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff
changeset
|
6 """ |
3cef0d445036
Start actual app structure
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff
changeset
|
7 |
3cef0d445036
Start actual app structure
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff
changeset
|
8 from django.test import TestCase |
3cef0d445036
Start actual app structure
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff
changeset
|
9 |
3cef0d445036
Start actual app structure
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff
changeset
|
10 class SimpleTest(TestCase): |
3cef0d445036
Start actual app structure
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff
changeset
|
11 def test_basic_addition(self): |
3cef0d445036
Start actual app structure
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff
changeset
|
12 """ |
3cef0d445036
Start actual app structure
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff
changeset
|
13 Tests that 1 + 1 always equals 2. |
3cef0d445036
Start actual app structure
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff
changeset
|
14 """ |
3cef0d445036
Start actual app structure
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff
changeset
|
15 self.failUnlessEqual(1 + 1, 2) |
3cef0d445036
Start actual app structure
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff
changeset
|
16 |
3cef0d445036
Start actual app structure
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff
changeset
|
17 __test__ = {"doctest": """ |
3cef0d445036
Start actual app structure
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff
changeset
|
18 Another way to test that 1 + 1 is equal to 2. |
3cef0d445036
Start actual app structure
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff
changeset
|
19 |
3cef0d445036
Start actual app structure
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff
changeset
|
20 >>> 1 + 1 == 2 |
3cef0d445036
Start actual app structure
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff
changeset
|
21 True |
3cef0d445036
Start actual app structure
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff
changeset
|
22 """} |
3cef0d445036
Start actual app structure
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff
changeset
|
23 |