Beispiel #1
0
    def test_SSoTenantForm_custom_regex(self):
        reload(tp_forms)
        data = {'remember': 'on', 'tenant': 'Git$^Hub'}

        form = tp_forms.SsoTenantForm(data)

        self.assertTrue(form.is_valid())
Beispiel #2
0
    def test_SsoTenantForm_no_tenant(self):
        data = {
            'remember': 'on',
        }

        form = tp_forms.SsoTenantForm(data)

        self.assertFalse(form.is_valid())
Beispiel #3
0
    def test_SsoTenantForm_tenant_alias(self):
        reload(tp_forms)
        data = {'remember': 'on', 'tenant': 'GitHub'}

        form = tp_forms.SsoTenantForm(data)

        self.assertTrue(form.is_valid())
        self.assertEqual('Company',
                         form.fields['tenant'].widget.attrs['placeholder'])
Beispiel #4
0
    def test_SsoTenantForm_tenant_invalid_chars(self):
        data = {'remember': 'on', 'tenant': 'Git*^$@#%)Hub'}

        form = tp_forms.SsoTenantForm(data)

        self.assertFalse(form.is_valid())
Beispiel #5
0
    def test_SsoTenantForm_no_rememeber(self):
        data = {'tenant': 'Git-Hub_123 Tenant'}

        form = tp_forms.SsoTenantForm(data)

        self.assertTrue(form.is_valid())
Beispiel #6
0
    def test_SsoTenantForm_remember(self):
        data = {'remember': 'on', 'tenant': 'GitHub'}

        form = tp_forms.SsoTenantForm(data)

        self.assertTrue(form.is_valid())