コード例 #1
0
 def setUp(self):
     self.request = RequestFactory().get('')
     self.view = setup_view(DataTableSourceView(), self.request)
コード例 #2
0
 def test_draw(self):
     self.view.request = RequestFactory().get('', {"draw": "1"})
     self.assertEqual(self.view.draw, 1)
コード例 #3
0
 def test_draw_none(self):
     self.view.request = RequestFactory().get('')
     with self.assertRaises(TypeError):
         self.view.draw
コード例 #4
0
 def test_order_direction_empty(self):
     self.view.request = RequestFactory().get('')
     self.assertEqual(self.view.order_direction, "")
コード例 #5
0
 def test_order_direction_asc(self):
     self.view.request = RequestFactory().get('', {"order[0][dir]": "asc"})
     self.assertEqual(self.view.order_direction, "")
コード例 #6
0
 def test_paging_page_length(self):
     self.view.request = RequestFactory().get('', {"length": "1"})
     self.assertEqual(self.view.paging_page_length, 1)
コード例 #7
0
 def test_paging_start_record(self):
     self.view.request = RequestFactory().get('', {"start": "1"})
     self.assertEqual(self.view.paging_start_record, 1)
コード例 #8
0
 def setUp(self):
     self.request = RequestFactory().get('/region_assignment/')
     self.request.user = create_user()
     self.view = setup_view(TempLanguageQuestionnaireView(), self.request)