Пример #1
0
    def test_get_column_context(self):

        view = views.PatientListTemplateView()

        class PL(patient_lists.PatientList):
            schema = [testmodels.Colour]

            @classmethod
            def get_slug(k):
                return 'the-slug'

        view.patient_list = PL

        expected = [
            dict(
                name='colour',
                title='Colour',
                single=False,
                icon='fa fa-comments',
                list_limit=None,
                template_path='records/colour.html',
                detail_template_path='records/colour.html',
            )
        ]
        context = view.get_column_context(slug='notarealthing')
        self.assertEqual(expected, context)
Пример #2
0
 def test_get_column_context_no_list(self):
     view = views.PatientListTemplateView()
     view.patient_list = None
     ctx = view.get_column_context(slug='notarealthing')
     self.assertEqual([], ctx)