Example #1
0
    def test_trust_present_returns_false_when_a_trust_is_not_present(self):
        form_content = {
            'role': 'meo',
            'permission_level': 'regional',
            'region': '1',
            'trust': None
        }
        form = PermissionBuilderForm(form_content)

        self.assertIsNone(form.trust)
        self.assertIsFalse(form.trust_present())

        form.trust = ''
        self.assertEqual(form.trust, '')
        self.assertIsFalse(form.trust_present())

        form.trust = 'None'
        self.assertEqual(form.trust, 'None')
        self.assertIsFalse(form.trust_present())
Example #2
0
    def test_trust_present_returns_true_when_a_trust_is_present(self):
        form_content = {
            'role': 'meo',
            'permission_level': 'trust',
            'region': None,
            'trust': '1'
        }
        form = PermissionBuilderForm(form_content)

        self.assertEqual(form.trust, form_content['trust'])
        self.assertIsTrue(form.trust_present())