def test_collectionVersionAddForm_containesOnlyDescription_formIsInvalid( self): form_data = { 'description': 'This is version 1.0', } form = CollectionVersionAddForm(data=form_data) self.assertFalse(form.is_valid())
def test_collectionVersionAddForm_containesBothIdAndDescription_version_missing_formIsValid( self): form_data = { 'id': 'v1.1', 'description': 'This is version 1.1', } form = CollectionVersionAddForm(data=form_data) self.assertFalse(form.is_valid())
def test_collectionVersionAddForm_containesBothIdAndDescription_formIsValid( self): form_data = { 'id': 'v1.1', 'description': 'This is version 1.1', 'previous_version': 'HEAD' } form = CollectionVersionAddForm(data=form_data) self.assertTrue(form.is_valid())
def test_collectionVersionAddForm_containesOnlyId_formIsInvalid(self): form_data = { 'id': 'v1.0', } form = CollectionVersionAddForm(data=form_data) self.assertFalse(form.is_valid())