~widelands-dev/widelands-website/trunk

438.1.6 by franku
run the script
1
"""This file demonstrates two different styles of tests (one doctest and one
215 by Holger Rapp
Added a simple events model to display dates on the homepage
2
unittest). These will both pass when you run "manage.py test".
3
4
Replace these with more appropriate tests for your application.
438.1.6 by franku
run the script
5
215 by Holger Rapp
Added a simple events model to display dates on the homepage
6
"""
7
8
from django.test import TestCase
9
438.1.6 by franku
run the script
10
215 by Holger Rapp
Added a simple events model to display dates on the homepage
11
class SimpleTest(TestCase):
438.1.6 by franku
run the script
12
215 by Holger Rapp
Added a simple events model to display dates on the homepage
13
    def test_basic_addition(self):
14
        """
15
        Tests that 1 + 1 always equals 2.
16
        """
532.1.1 by franku
converted to python 3.6 using 2to3 script
17
        self.assertEqual(1 + 1, 2)
215 by Holger Rapp
Added a simple events model to display dates on the homepage
18
438.1.6 by franku
run the script
19
__test__ = {'doctest': """
215 by Holger Rapp
Added a simple events model to display dates on the homepage
20
Another way to test that 1 + 1 is equal to 2.
21
22
>>> 1 + 1 == 2
23
True
24
"""}