def setUp(self): self.request = RequestFactory().get('') self.view = setup_view(DataTableSourceView(), self.request)
def test_draw(self): self.view.request = RequestFactory().get('', {"draw": "1"}) self.assertEqual(self.view.draw, 1)
def test_draw_none(self): self.view.request = RequestFactory().get('') with self.assertRaises(TypeError): self.view.draw
def test_order_direction_empty(self): self.view.request = RequestFactory().get('') self.assertEqual(self.view.order_direction, "")
def test_order_direction_asc(self): self.view.request = RequestFactory().get('', {"order[0][dir]": "asc"}) self.assertEqual(self.view.order_direction, "")
def test_paging_page_length(self): self.view.request = RequestFactory().get('', {"length": "1"}) self.assertEqual(self.view.paging_page_length, 1)
def test_paging_start_record(self): self.view.request = RequestFactory().get('', {"start": "1"}) self.assertEqual(self.view.paging_start_record, 1)
def setUp(self): self.request = RequestFactory().get('/region_assignment/') self.request.user = create_user() self.view = setup_view(TempLanguageQuestionnaireView(), self.request)