2014-04-12 17:42:06 +08:00
|
|
|
import doctest
|
2013-07-02 03:49:11 +08:00
|
|
|
from unittest import TestCase
|
2013-05-11 11:08:45 +08:00
|
|
|
|
2016-02-20 03:13:54 +08:00
|
|
|
from django.test import SimpleTestCase, TestCase as DjangoTestCase, tag
|
2014-04-12 17:42:06 +08:00
|
|
|
|
|
|
|
from . import doctests
|
2013-05-11 11:08:45 +08:00
|
|
|
|
|
|
|
|
2013-07-02 03:49:11 +08:00
|
|
|
class TestVanillaUnittest(TestCase):
|
2013-05-11 11:08:45 +08:00
|
|
|
|
|
|
|
def test_sample(self):
|
|
|
|
self.assertEqual(1, 1)
|
|
|
|
|
|
|
|
|
|
|
|
class TestDjangoTestCase(DjangoTestCase):
|
|
|
|
|
|
|
|
def test_sample(self):
|
|
|
|
self.assertEqual(1, 1)
|
2013-12-17 00:04:28 +08:00
|
|
|
|
|
|
|
|
2014-04-12 17:42:06 +08:00
|
|
|
class TestZimpleTestCase(SimpleTestCase):
|
|
|
|
# Z is used to trick this test case to appear after Vanilla in default suite
|
|
|
|
|
|
|
|
def test_sample(self):
|
|
|
|
self.assertEqual(1, 1)
|
|
|
|
|
|
|
|
|
2013-12-17 00:04:28 +08:00
|
|
|
class EmptyTestCase(TestCase):
|
|
|
|
pass
|
2014-04-12 17:42:06 +08:00
|
|
|
|
|
|
|
|
2015-11-07 21:57:56 +08:00
|
|
|
@tag('slow')
|
|
|
|
class TaggedTestCase(TestCase):
|
|
|
|
|
|
|
|
@tag('fast')
|
|
|
|
def test_single_tag(self):
|
|
|
|
self.assertEqual(1, 1)
|
|
|
|
|
|
|
|
@tag('fast', 'core')
|
|
|
|
def test_multiple_tags(self):
|
|
|
|
self.assertEqual(1, 1)
|
|
|
|
|
|
|
|
|
2014-04-12 17:42:06 +08:00
|
|
|
def load_tests(loader, tests, ignore):
|
|
|
|
tests.addTests(doctest.DocTestSuite(doctests))
|
|
|
|
return tests
|