class TestNotFound(TestCase): def setUp(self): self.nf = NotFound() self.nf.response = Mock() def test_get(self): r = self.nf.get() self.assertEqual(self.nf.response.status_code, 404) self.assertEqual(r, 'Not found') def test_post_put_delete(self): for method in ['post', 'put', 'delete']: self.assertEqual(getattr(self.nf, method), self.nf.get)
def setUp(self): self.nf = NotFound() self.nf.response = Mock()