forked from adamlaska/datatracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtests.py
More file actions
42 lines (37 loc) · 1.55 KB
/
Copy pathtests.py
File metadata and controls
42 lines (37 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Copyright The IETF Trust 2007, All Rights Reserved
#
import doctest
from ietf.idtracker.templatetags import ietf_filters
import unittest
from ietf.utils.test_utils import SimpleUrlTestCase, canonicalize_feed, canonicalize_sitemap
import django.test
class TemplateTagTest(unittest.TestCase):
def testTemplateTags(self):
print " Testing ietf_filters"
#doctest.testmod(ietf_filters,verbose=True)
(failures, tests) = doctest.testmod(ietf_filters)
self.assertEqual(failures, 0)
print "OK (ietf_filters)"
class IdTrackerUrlTestCase(SimpleUrlTestCase):
def testUrls(self):
self.doTestUrls(__file__)
def doCanonicalize(self, url, content):
if url.startswith("/feed/"):
return canonicalize_feed(content)
elif url.startswith("/sitemap"):
return canonicalize_sitemap(content)
else:
return content
class WGRoleTest(django.test.TestCase):
fixtures = ['wgtest']
def setUp(self):
from ietf.idtracker.models import IETFWG
self.xmas = IETFWG.objects.get(group_acronym__acronym='xmas')
self.snow = IETFWG.objects.get(group_acronym__acronym='snow')
def test_roles(self):
print " Testing WG roles"
self.assertEquals(self.xmas.wgchair_set.all()[0].role(), 'xmas WG Chair')
self.assertEquals(self.snow.wgchair_set.all()[0].role(), 'snow BOF Chair')
self.assertEquals(self.xmas.wgsecretary_set.all()[0].role(), 'xmas WG Secretary')
self.assertEquals(self.xmas.wgtechadvisor_set.all()[0].role(), 'xmas Technical Advisor')
print "OK"