コード例 #1
0
ファイル: test_patient_lists.py プロジェクト: ahillebra/Aceso
 def test_for_list_raises_if_non_list_passed(self):
     with self.assertRaises(ValueError):
         TabbedPatientListGroup.for_list(None)
     with self.assertRaises(ValueError):
         TabbedPatientListGroup.for_list(2)
     with self.assertRaises(ValueError):
         TabbedPatientListGroup.for_list('Carnivores')
     with self.assertRaises(ValueError):
         TabbedPatientListGroup.for_list(OpalTestCase)
コード例 #2
0
ファイル: test_patient_lists.py プロジェクト: mattstibbs/opal
 def test_for_list_raises_if_non_list_passed(self):
     with self.assertRaises(ValueError):
         TabbedPatientListGroup.for_list(None)
     with self.assertRaises(ValueError):
         TabbedPatientListGroup.for_list(2)
     with self.assertRaises(ValueError):
         TabbedPatientListGroup.for_list('Carnivores')
     with self.assertRaises(ValueError):
         TabbedPatientListGroup.for_list(OpalTestCase)
コード例 #3
0
ファイル: views.py プロジェクト: Charlisim/opal
    def get_context_data(self, **kwargs):
        context = super(PatientListTemplateView,
                        self).get_context_data(**kwargs)
        list_slug = None
        if self.patient_list:
            list_slug = self.patient_list.get_slug()
        context['list_slug'] = list_slug
        context['patient_list'] = self.patient_list
        context['lists'] = PatientList.for_user(self.request.user)

        context['list_group'] = None
        if self.patient_list:
            group = TabbedPatientListGroup.for_list(self.patient_list)
            if group:
                if group.visible_to(self.request.user):
                    context['list_group'] = group

        context['columns'] = self.get_column_context(**kwargs)
        return context
コード例 #4
0
ファイル: views.py プロジェクト: openhealthcare/opal
    def get_context_data(self, **kwargs):
        context = super(
            PatientListTemplateView, self
        ).get_context_data(**kwargs)
        list_slug = None
        if self.patient_list:
            list_slug = self.patient_list.get_slug()
        context['list_slug'] = list_slug
        context['patient_list'] = self.patient_list
        context['lists'] = list(PatientList.for_user(self.request.user))
        context['num_lists'] = len(context['lists'])

        context['list_group'] = None
        if self.patient_list:
            group = TabbedPatientListGroup.for_list(self.patient_list)
            if group:
                if group.visible_to(self.request.user):
                    context['list_group'] = group

        context['columns'] = self.get_column_context(**kwargs)
        return context
コード例 #5
0
ファイル: test_patient_lists.py プロジェクト: ahillebra/Aceso
 def test_for_list(self):
     self.assertEqual(TestTabbedPatientListGroup,
                      TabbedPatientListGroup.for_list(InvisibleList))
コード例 #6
0
ファイル: test_patient_lists.py プロジェクト: mattstibbs/opal
 def test_for_list(self):
     self.assertEqual(TestTabbedPatientListGroup,
                      TabbedPatientListGroup.for_list(InvisibleList))