aboutsummaryrefslogtreecommitdiff
blob: e6360a930d8af4cbfda7a0901870d3fcb51270b3 (plain)
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
43
# vim:fileencoding=utf8:et:ts=4:sts=4:sw=4:ft=python

from django.conf import settings
from django.test import TestCase
from django.test.client import Client

from mockldap import MockLdap

from okupy.tests import vars


class ListsIntegrationTests(TestCase):
    @classmethod
    def setUpClass(cls):
        cls.mockldap = MockLdap(vars.DIRECTORY)

    @classmethod
    def tearDownClass(cls):
        del cls.mockldap

    def setUp(self):
        self.client = Client()
        self.mockldap.start()
        self.ldapobj = self.mockldap[settings.AUTH_LDAP_SERVER_URI]

    def tearDown(self):
        self.mockldap.stop()
        del self.ldapobj

    def test_devlist_page_uses_correct_template(self):
        response = self.client.get('/devlist/')
        self.assertTemplateUsed(response, 'base.html')
        self.assertTemplateUsed(response, 'devlist.html')

    def test_former_devlist_page_uses_correct_template(self):
        response = self.client.get('/former-devlist/')
        self.assertTemplateUsed(response, 'base.html')
        self.assertTemplateUsed(response, 'former-devlist.html')

    def test_foundation_members_page_uses_correct_template(self):
        response = self.client.get('/foundation-members/')
        self.assertTemplateUsed(response, 'base.html')
        self.assertTemplateUsed(response, 'foundation-members.html')