def test_organization_api_delete_deleted(self, api): '''It should not delete a deleted organization from the API''' api.login() organization = OrganizationFactory(deleted=datetime.now()) response = api.delete(url_for('api.organization', org=organization)) assert410(response) assert Organization.objects[0].deleted is not None
def test_organization_api_update_deleted(self, api): '''It should not update a deleted organization from the API''' org = OrganizationFactory(deleted=datetime.now()) data = org.to_dict() data['description'] = 'new description' api.login() response = api.put(url_for('api.organization', org=org), data) assert410(response) assert Organization.objects.first().description == org.description
def test_organization_api_get_deleted(self, api): '''It should not fetch a deleted organization from the API''' organization = OrganizationFactory(deleted=datetime.now()) response = api.get(url_for('api.organization', org=organization)) assert410(response)
def test_reuse_api_get_deleted(self, api): '''It should not fetch a deleted reuse from the API and raise 410''' reuse = ReuseFactory(deleted=datetime.now()) response = api.get(url_for('api.reuse', reuse=reuse)) assert410(response)
def test_reuse_api_delete_deleted(self, api): '''It should not delete a deleted reuse from the API and raise 410''' api.login() reuse = ReuseFactory(deleted=datetime.now()) response = api.delete(url_for('api.reuse', reuse=reuse)) assert410(response)