コード例 #1
0
    def test_a_without_permission(self):
        self.academic_calendar.delete()

        result = button_with_permission(self.context, "title", "id", "edit")
        self.assertEqual(
            result,
            BUTTON_TEMPLATE.format(PERMISSION_DENIED_MSG, "id", "disabled",
                                   "fa-edit"))
コード例 #2
0
 def test_button_with_permission(self):
     result = button_with_permission(self.context, "title", "edit", "#")
     self.assertDictEqual(
         result, {
             'title': 'title',
             'class_button': 'btn-default btn-sm ',
             'load_modal': True,
             'url': '#',
             'icon': 'fa-edit'
         })
コード例 #3
0
 def test_button_tag_case_inside_education_group_edition_period(self):
     result = button_with_permission(self.context, "title", "edit", "#")
     self.assertDictEqual(
         result, {
             'load_modal': True,
             'title': 'title',
             'class_button': 'btn-default btn-sm ',
             'url': '#',
             'icon': 'fa-edit'
         })
コード例 #4
0
    def test_button_tag_case_not_in_education_group_edition_period(self):
        """ This test ensure that as faculty manager, the button tag is disabled when outside of encoding period"""
        self.academic_calendar.delete()

        result = button_with_permission(self.context, "title", "edit", "#")
        self.assertDictEqual(
            result, {
                'class_button': 'btn-default btn-sm disabled',
                'load_modal': False,
                'url': '#',
                'title': _("The education group edition period is not open."),
                'icon': 'fa-edit'
            })
コード例 #5
0
 def test_button_with_permission(self):
     result = button_with_permission(self.context, "title", "id", "edit")
     self.assertEqual(result, BUTTON_TEMPLATE.format("title", "id", "", "fa-edit"))
コード例 #6
0
    def test_button_tag_case_inside_education_group_edition_period(self):
        self.education_group_year.academic_year = self.next_ac

        result = button_with_permission(self.context, "title", "id", "edit")
        self.assertEqual(result, BUTTON_TEMPLATE.format("title", "id", "", "fa-edit"))
コード例 #7
0
    def test_button_tag_case_not_in_education_group_edition_period(self):
        """ This test ensure that as faculty manager, the button tag is disabled when outside of encoding period"""
        self.academic_calendar.delete()

        result = button_with_permission(self.context, "title", "id", "edit")
        self.assertEqual(result, BUTTON_TEMPLATE.format(PERMISSION_DENIED_MSG, "id", "disabled", "fa-edit"))