Beispiel #1
0
    def test_collections_digital(self):
        request = self.factory.get('/collection/?view=collections&digital=on')
        request.user = self.user
        response = collections(request)

        self.assertContains(
            response, '<input name="digital" type="checkbox" aria-label="limit to digital collections" id="checkboxdigital" checked="checked">', html=True)
Beispiel #2
0
    def test_exhibit_digital_none(self):
        request = self.factory.get(
            '/collection/?view=exhibits&digital=%s' % None)
        request.user = self.user
        response = collections(request)

        self.assertEqual(response.status_code, 200)
Beispiel #3
0
    def test_collections_subject(self):
        subjects_list = list(
            Subject.objects.all().values_list("name", flat=True))
        for s in subjects_list:
            request = self.factory.get(
                '/collection/?view=collections&subject=%s' % s)
            request.user = self.user
            response = collections(request)

            self.assertEqual(response.status_code, 200)
Beispiel #4
0
    def test_collections_location(self):
        locations_list = list(
            LocationPage.objects.live().values_list('title', flat=True))
        for l1 in locations_list:
            request = self.factory.get(
                '/collection/?view=collections&location=%s' % l1)
            request.user = self.user
            response = collections(request)

            self.assertEqual(response.status_code, 200)
Beispiel #5
0
    def test_view_exhibit(self):
        request = self.factory.get('/collection/?view=exhibits')
        request.user = self.user
        response = collections(request)

        self.assertEqual(response.status_code, 200)
Beispiel #6
0
    def test_view_invalid(self):
        request = self.factory.get('/collection/?view=gibberish')
        request.user = self.user
        response = collections(request)

        self.assertEqual(response.status_code, 200)