コード例 #1
0
    def test_view(self):
        view_func = ErrorView.as_view(error_message="some message or other",
                                      error_code=499,
                                      headline="some headline")

        request = RequestFactory().get("/")
        response = view_func(request)

        self.assertEqual(response.status_code, 499)
        self.assertIn("some message or other", str(response.content))
        self.assertIn("some headline", str(response.content))
コード例 #2
0
ファイル: test_misc.py プロジェクト: Inboxen/Inboxen
    def test_view(self):
        view_func = ErrorView.as_view(
            error_message="some message or other",
            error_code=499,
            headline="some headline"
        )

        request = RequestFactory().get("/")
        response = view_func(request)

        self.assertEqual(response.status_code, 499)
        self.assertIn("some message or other", str(response.content))
        self.assertIn("some headline", str(response.content))