Beispiel #1
0
 def test_detail_template_list(self, find):
     with warnings.catch_warnings(record=True):
         patient_list = MagicMock()
         patient_list.get_prefixes.return_value = []
         Subrecord.get_detail_template(patient_list=patient_list)
         find.assert_called_with(
             ['records/subrecord_detail.html', 'records/subrecord.html'])
Beispiel #2
0
 def test_detail_template_episode_type(self, find):
     Subrecord.get_detail_template(episode_type='Inpatient')
     find.assert_called_with([
         'records/inpatient/subrecord_detail.html',
         'records/inpatient/subrecord.html',
         'records/subrecord_detail.html', 'records/subrecord.html'
     ])
Beispiel #3
0
 def test_detail_template_prefixes(self, find):
     find.return_value = None
     Subrecord.get_detail_template(prefixes=['onions'])
     self.assertEqual(find.call_args_list[0][0][0], [
         'records/onions/subrecord_detail.html',
         'records/onions/subrecord.html', 'records/subrecord_detail.html',
         'records/subrecord.html'
     ])
Beispiel #4
0
 def test_detail_template_episode_type(self, find):
     with warnings.catch_warnings(record=True):
         find.return_value = None
         Subrecord.get_detail_template(episode_type='Inpatient')
         self.assertEqual(find.call_args_list[0][0][0], [
             'records/inpatient/subrecord_detail.html',
             'records/inpatient/subrecord.html',
             'records/subrecord_detail.html', 'records/subrecord.html'
         ])
Beispiel #5
0
 def test_detail_template_prefixes(self, find):
     find.return_value = None
     Subrecord.get_detail_template(prefixes=['onions'])
     self.assertEqual(find.call_args_list[0][0][0], [
         os.path.join('records', 'onions', 'subrecord_detail.html'),
         os.path.join('records', 'onions', 'subrecord.html'),
         os.path.join('records', 'subrecord_detail.html'),
         os.path.join('records', 'subrecord.html'),
     ])
Beispiel #6
0
 def test_detail_template_list_and_prefix(self, find):
     patient_list = MagicMock()
     patient_list.get_template_prefixes = MagicMock(return_value=["test"])
     Subrecord.get_detail_template(prefixes=["onions"],
                                   patient_list=patient_list)
     find.assert_called_with([
         'records/onions/subrecord_detail.html',
         'records/onions/subrecord.html',
         'records/test/subrecord_detail.html',
         'records/test/subrecord.html', 'records/subrecord_detail.html',
         'records/subrecord.html'
     ])
Beispiel #7
0
 def test_detail_template_prefixes(self, find):
     find.return_value = None
     Subrecord.get_detail_template(prefixes=['onions'])
     self.assertEqual(
         find.call_args_list[0][0][0],
         [
             os.path.join('records', 'onions', 'subrecord_detail.html'),
             os.path.join('records', 'onions', 'subrecord.html'),
             os.path.join('records', 'subrecord_detail.html'),
             os.path.join('records', 'subrecord.html'),
         ]
     )
Beispiel #8
0
 def test_detail_template_prefixes(self, find):
     find.return_value = None
     Subrecord.get_detail_template(prefixes=['onions'])
     self.assertEqual(
         find.call_args_list[0][0][0],
         [
             'records/onions/subrecord_detail.html',
             'records/onions/subrecord.html',
             'records/subrecord_detail.html',
             'records/subrecord.html'
         ]
     )
Beispiel #9
0
 def test_detail_template(self, find):
     Subrecord.get_detail_template()
     find.assert_called_with(
         ['records/subrecord_detail.html', 'records/subrecord.html'])
Beispiel #10
0
 def test_detail_template(self, find):
     Subrecord.get_detail_template()
     find.assert_called_with([
         os.path.join('records', 'subrecord_detail.html'),
         os.path.join('records', 'subrecord.html'),
     ])
Beispiel #11
0
 def test_detail_template_list_episode_type(self, find):
     with self.assertRaises(ValueError):
         Subrecord.get_detail_template(episode_type='Inpatient',
                                       patient_list='test')
Beispiel #12
0
 def test_detail_template_list(self, find):
     Subrecord.get_detail_template(patient_list='test')
     find.assert_called_with(
         ['records/subrecord_detail.html', 'records/subrecord.html'])
Beispiel #13
0
 def test_detail_template_subteam(self, select):
     Subrecord.get_detail_template(team='test', subteam='really')
     select.assert_called_with(
         ['records/subrecord_detail.html', 'records/subrecord.html'])
Beispiel #14
0
 def test_detail_template(self, select):
     Subrecord.get_detail_template()
     select.assert_called_with(
         ['records/subrecord_detail.html', 'records/subrecord.html'])
Beispiel #15
0
 def test_detail_template_subteam(self, select):
     Subrecord.get_detail_template(team='test', subteam='really')
     select.assert_called_with(['records/subrecord_detail.html', 'records/subrecord.html'])
Beispiel #16
0
 def test_detail_template(self, select):
     Subrecord.get_detail_template()
     select.assert_called_with([
         'records/subrecord_detail.html',
         'records/subrecord.html'
     ])
Beispiel #17
0
 def test_detail_template_does_not_exist(self):
     self.assertEqual(None, Subrecord.get_detail_template())
Beispiel #18
0
 def test_detail_template_does_not_exist(self):
     self.assertEqual(None, Subrecord.get_detail_template())
Beispiel #19
0
 def test_detail_template(self, find):
     Subrecord.get_detail_template()
     find.assert_called_with([
         os.path.join('records', 'subrecord_detail.html'),
         os.path.join('records', 'subrecord.html'),
     ])
Beispiel #20
0
 def test_detail_template(self, find):
     Subrecord.get_detail_template()
     find.assert_called_with([
         'records/subrecord_detail.html',
         'records/subrecord.html'
     ])