summaryrefslogtreecommitdiff
path: root/devel/tests/test_devel.py
blob: c6a67cb59da49f3b78664d5ef5a17b2628a0d228 (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
from django.test import TransactionTestCase
from django.contrib.auth.models import User


class DevelView(TransactionTestCase):
    fixtures = ['main/fixtures/arches.json', 'main/fixtures/repos.json',
                'main/fixtures/package.json']

    def setUp(self):
        password = 'test'
        self.user = User.objects.create_superuser('admin',
                                                  'admin@archlinux.org',
                                                  password)
        self.client.post('/login/', {
                                    'username': self.user.username,
                                    'password': password
        })

    def tearDown(self):
        self.user.delete()

    def test_clock(self):
        response = self.client.get('/devel/clock/')
        self.assertEqual(response.status_code, 200)

    def test_profile(self):
        response = self.client.get('/devel/profile/')
        self.assertEqual(response.status_code, 200)
        # Test changing

    def test_stats(self):
        response = self.client.get('/devel/stats/')
        self.assertEqual(response.status_code, 200)