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
34 lines (27 loc) · 1.22 KB
/
tests.py
File metadata and controls
34 lines (27 loc) · 1.22 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
from django.urls import reverse
from ietf.group.factories import GroupFactory, GroupEventFactory
from ietf.group.models import Group, GroupEvent
from ietf.person.models import Person
from ietf.utils.test_utils import TestCase
SECR_USER='secretary'
def augment_data():
system = Person.objects.get(name="(System)")
area = Group.objects.get(acronym='farfut')
GroupEvent.objects.create(group=area,
type='started',
by=system)
class SecrAreasTestCase(TestCase):
def test_main(self):
"Main Test"
GroupFactory(type_id='area')
url = reverse('ietf.secr.areas.views.list_areas')
self.client.login(username="secretary", password="secretary+password")
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
def test_view(self):
"View Test"
area = GroupEventFactory(type='started',group__type_id='area').group
url = reverse('ietf.secr.areas.views.view', kwargs={'name':area.acronym})
self.client.login(username="secretary", password="secretary+password")
response = self.client.get(url)
self.assertEqual(response.status_code, 200)