Exemple #1
0
    def test_render_index(self):
        institution = InstitutionFactory.create()

        request = self.factory.get('/')
        response = show_index(request, institution.siglum)
        self.assertEqual(response.status_code, 200)
        self.assertFalse('O olho neles é' in response.content)
        self.assertIn(institution.siglum, response.content)
Exemple #2
0
    def test_render_index_without_institution(self):
        try:
            request = self.factory.get('/')
            response = show_index(request)
        except TypeError as e:
            response = None
            msg = 'show_index() takes exactly 2 arguments (1 given)'
            self.assertEqual(e.message, msg)

        self.assertEqual(response, None)
Exemple #3
0
 def test_render_index_with_empty_institution(self):
     request = self.factory.get('/')
     response = show_index(request, '')
     self.assertEqual(response.status_code, 200)
     self.assertTrue('O olho neles é' in response.content)