@pytest.mark.django_db
def test_project_save_no_code(project0):
 project0.code = ''
 with pytest.raises(ValidationError):
  project0.save()

@ pytest . mark . django_db def test_project_save_no_code ( project0 ) : project0 . code = '' with pytest . raises ( ValidationError ) : project0 . save ( )
test that an existing project cant be removed its code .