fd7137fe9c5973bcbef418942e7100599c9eea30
[auf_savoirs_en_partage_django.git] / auf_savoirs_en_partage / savoirs / tests.py
1 # coding: utf-8
2
3 from django.test import TestCase
4
5 class PageLoadTest(TestCase):
6
7 fixtures = ['tests.yaml']
8
9 def check_status_200(self, path, data={}):
10 response = self.client.get(path, data)
11 self.assertEqual(response.status_code, 200)
12
13 def test_accueil(self):
14 self.check_status_200('/')
15 self.check_status_200('/region/1/')
16 self.check_status_200('/discipline/1/')
17 self.check_status_200('/discipline/1/region/1/')
18
19 def test_recherche(self):
20 self.check_status_200('/recherche/', dict(q='francophonie'))
21 self.check_status_200('/region/1/recherche/', dict(q=u'université'))
22 self.check_status_200('/discipline/1/recherche/', dict(q='ours noir'))
23 self.check_status_200('/discipline/1/region/1/recherche/', dict(q='orientations -australie'))
24
25 def test_ressources(self):
26 self.check_status_200('/ressources/')
27
28 def test_ressource(self):
29 self.check_status_200('/ressources/1/')
30
31 def test_agenda(self):
32 self.check_status_200('/agenda/')
33 self.check_status_200('/agenda/evenements/utilisation/')
34 self.check_status_200('/agenda/evenements/creer/')
35
36 def test_evenement(self):
37 self.check_status_200('/agenda/evenements/1/')
38
39 def test_actualites(self):
40 self.check_status_200('/actualites/')
41 self.check_status_200('/rss/actualites/')
42
43 def test_actualite(self):
44 self.check_status_200('/actualites/1/')
45 self.check_status_200('/actualites/2/')
46
47 def test_appels(self):
48 self.check_status_200('/appels/')
49 self.check_status_200('/rss/appels/')
50
51 def test_chercheurs(self):
52 self.check_status_200('/chercheurs/')
53 self.check_status_200('/chercheurs/', dict(tri='nom'))
54 self.check_status_200('/chercheurs/', dict(tri='nom_desc'))
55 self.check_status_200('/chercheurs/', dict(tri='etablissement'))
56 self.check_status_200('/chercheurs/', dict(tri='etablissement_desc'))
57 self.check_status_200('/chercheurs/', dict(tri='pays'))
58 self.check_status_200('/chercheurs/', dict(tri='pays_desc'))
59
60 def test_sites(self):
61 self.check_status_200('/sites/')
62
63 def test_sites_auf(self):
64 self.check_status_200('/sites-auf/')
65
66 def test_contact(self):
67 self.check_status_200('/nous-contacter/')
68
69 def test_legal(self):
70 self.check_status_200('/legal/')
71
72 def test_a_propos(self):
73 self.check_status_200('/a-propos/')