Example #1
0
    def test_404_views(self):
        """Test views that should give a 404 error"""

        get_404(
            self.client,
            reverse(
                'foia-detail',
                kwargs={
                    'idx': 1,
                    'slug': 'test-c',
                    'jurisdiction': 'massachusetts',
                    'jidx': 1
                }
            )
        )
        get_404(
            self.client,
            reverse(
                'foia-detail',
                kwargs={
                    'idx': 2,
                    'slug': 'test-c',
                    'jurisdiction': 'massachusetts',
                    'jidx': 1
                }
            )
        )
Example #2
0
    def test_404_views(self):
        """Test views that should give a 404 error"""

        get_404(
            self.client,
            reverse(
                "foia-detail",
                kwargs={
                    "idx": 1,
                    "slug": "test-c",
                    "jurisdiction": "massachusetts",
                    "jidx": 1,
                },
            ),
        )
        get_404(
            self.client,
            reverse(
                "foia-detail",
                kwargs={
                    "idx": 2,
                    "slug": "test-c",
                    "jurisdiction": "massachusetts",
                    "jidx": 1,
                },
            ),
        )
Example #3
0
 def test_news_archive_day_empty(self):
     """Should return 404 for a day with no articles"""
     get_404(
         self.client,
         reverse('news-archive-day',
                 kwargs={
                     'year': 1999,
                     'month': 'mar',
                     'day': 1
                 }))
Example #4
0
 def test_news_archive_day_empty(self):
     """Should return 404 for a day with no articles"""
     get_404(
         self.client,
         reverse("news-archive-day",
                 kwargs={
                     "year": 1999,
                     "month": "mar",
                     "day": 1
                 }),
     )
Example #5
0
 def test_news_detail_404(self):
     """Should give a 404 error for a article that doesn't exist"""
     get_404(
         self.client,
         reverse('news-detail',
                 kwargs={
                     'year': 1999,
                     'month': 'mar',
                     'day': 1,
                     'slug': 'test-article-1'
                 }))
Example #6
0
 def test_news_detail_404(self):
     """Should give a 404 error for a article that doesn't exist"""
     get_404(
         self.client,
         reverse(
             "news-detail",
             kwargs={
                 "year": 1999,
                 "month": "mar",
                 "day": 1,
                 "slug": "test-article-1",
             },
         ),
     )