コード例 #1
0
 def test_to_dict_passes_queryset(self, serialised):
     serialised.return_value = {}
     with patch.object(PatientList, 'get_queryset') as gq:
         with patch.object(PatientList, 'queryset', new_callable=PropertyMock) as q:
             dicted = PatientList().to_dict('my_user')
             gq.assert_called_with(user='******')
             self.assertEqual({}, dicted)
コード例 #2
0
ファイル: test_patient_lists.py プロジェクト: ahillebra/Aceso
 def test_get_template_names_default(self):
     self.assertEqual(['patient_lists/layouts/spreadsheet_list.html'],
                      PatientList().get_template_names())
コード例 #3
0
ファイル: test_patient_lists.py プロジェクト: ahillebra/Aceso
 def test_get_queryset_default(self):
     mock_queryset = MagicMock('Mock Queryset')
     with patch.object(PatientList, 'queryset',
                       new_callable=PropertyMock) as queryset:
         queryset.return_value = mock_queryset
         self.assertEqual(mock_queryset, PatientList().get_queryset())
コード例 #4
0
ファイル: test_patient_lists.py プロジェクト: ahillebra/Aceso
 def test_unimplemented_queryset(self):
     with self.assertRaises(ValueError):
         queryset = PatientList().queryset
コード例 #5
0
ファイル: test_patient_lists.py プロジェクト: ahillebra/Aceso
 def test_unimplemented_schema(self):
     with self.assertRaises(ValueError):
         schema = PatientList().schema
コード例 #6
0
 def test_to_dict_passes_queryset(self):
     with patch.object(PatientList, 'get_queryset') as gq:
         with patch.object(PatientList, 'queryset', new_callable=PropertyMock) as q:
             PatientList().to_dict('my_user')
             gq.assert_called_with(user='******')