Example #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'])
Example #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'
     ])
Example #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'
     ])
Example #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'
         ])
Example #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'),
     ])
Example #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'
     ])
Example #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'),
         ]
     )
Example #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'
         ]
     )
Example #9
0
 def test_detail_template(self, find):
     Subrecord.get_detail_template()
     find.assert_called_with(
         ['records/subrecord_detail.html', 'records/subrecord.html'])
Example #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'),
     ])
Example #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')
Example #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'])
Example #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'])
Example #14
0
 def test_detail_template(self, select):
     Subrecord.get_detail_template()
     select.assert_called_with(
         ['records/subrecord_detail.html', 'records/subrecord.html'])
Example #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'])
Example #16
0
 def test_detail_template(self, select):
     Subrecord.get_detail_template()
     select.assert_called_with([
         'records/subrecord_detail.html',
         'records/subrecord.html'
     ])
Example #17
0
 def test_detail_template_does_not_exist(self):
     self.assertEqual(None, Subrecord.get_detail_template())
Example #18
0
 def test_detail_template_does_not_exist(self):
     self.assertEqual(None, Subrecord.get_detail_template())
Example #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'),
     ])
Example #20
0
 def test_detail_template(self, find):
     Subrecord.get_detail_template()
     find.assert_called_with([
         'records/subrecord_detail.html',
         'records/subrecord.html'
     ])