def test_domainuser_name_form_filled(self): """ test minimum form requirements / INVALID """ # get object form = DomainuserForm(data={'domainuser_name': 'domainuser_1'}) # compare self.assertFalse(form.is_valid())
def test_domainuser_form_empty(self): """ test minimum form requirements / INVALID """ # get object form = DomainuserForm(data={}) # compare self.assertFalse(form.is_valid())
def test_domainuser_domain_form_filled(self): """ test minimum form requirements / VALID """ # get foreign key object id domain_id = Domain.objects.get(domain_name='domain_1').domain_id # get object form = DomainuserForm(data={ 'domainuser_name': 'domainuser_1', 'domain': domain_id, }) # compare self.assertTrue(form.is_valid())
def test_domainuser_name_too_many_chars(self): """test for max length""" # get foreign key object id domain_id = Domain.objects.get(domain_name='domain_1').domain_id # get object form = DomainuserForm(data={ 'domainuser_name': 'd' * 51, 'domain': domain_id, }) # compare self.assertFalse(form.is_valid())
def test_domainuser_domain_form_label(self): """ test form label """ # get object form = DomainuserForm() # compare self.assertEquals(form.fields['domain'].label, 'Domain (*)')
def test_domainuser_system_was_logged_on_form_label(self): """ test form label """ # get object form = DomainuserForm() # compare self.assertEqual(form.fields['system_was_logged_on'].label, 'Systems where this domainuser was logged on')