def testAddInvalid(self): dc_form = forms.DocumentCategoryForm({ "name": "MöKomÄP", "description": "MoKomAP with invalid name" }) assert not dc_form.is_valid() dc_form = forms.DocumentCategoryForm({ "name": "MoKomAP", "description": "MoKomAP with valid name" }) assert dc_form.is_valid()
def testAddInvalid(self): dc_form = forms.DocumentCategoryForm({ 'name': u'MöKomÄP', 'description': u'MoKomAP with invalid name' }) self.assertFalse(dc_form.is_valid()) dc_form = forms.DocumentCategoryForm({ 'name': u'MoKomAP', 'description': u'MoKomAP with valid name' }) self.assertTrue(dc_form.is_valid())
def testAddInsensitiveDuplicate(self): """Test whether DocumentCategory name field is unique in any case""" models.DocumentCategory.objects.create(name="test", description="Test category") dc_form = forms.DocumentCategoryForm({ "name": "Test", "description": "Another test category" }) assert not dc_form.is_valid()
def testAddInsensitiveDuplicate(self): """Test whether DocumentCategory name field is unique in any case""" models.DocumentCategory.objects.create(name='test', description='Test category') dc_form = forms.DocumentCategoryForm({ 'name': 'Test', 'description': 'Another test category' }) self.assertFalse(dc_form.is_valid())
def testAddDuplicate(self): """Test whether DocumentCategory name field is unique""" models.DocumentCategory.objects.create(name='test', description='Test category') dc_form = forms.DocumentCategoryForm({'name': 'test', 'description': 'Another test category'}) assert not dc_form.is_valid()