Beispiel #1
0
 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()
Beispiel #2
0
 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())
Beispiel #3
0
 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()
Beispiel #4
0
 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())
Beispiel #5
0
 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()