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())
def test_SsoTenantForm_no_tenant(self): data = { 'remember': 'on', } form = tp_forms.SsoTenantForm(data) self.assertFalse(form.is_valid())
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'])
def test_SsoTenantForm_tenant_invalid_chars(self): data = {'remember': 'on', 'tenant': 'Git*^$@#%)Hub'} form = tp_forms.SsoTenantForm(data) self.assertFalse(form.is_valid())
def test_SsoTenantForm_no_rememeber(self): data = {'tenant': 'Git-Hub_123 Tenant'} form = tp_forms.SsoTenantForm(data) self.assertTrue(form.is_valid())
def test_SsoTenantForm_remember(self): data = {'remember': 'on', 'tenant': 'GitHub'} form = tp_forms.SsoTenantForm(data) self.assertTrue(form.is_valid())