test deprecated endpoints
@@ -179,3 +179,77 @@ class TestPagination:
'detail': 'Invalid cursor',
'source': {'pointer': '/data'},
}]}
+
+
+@pytest.mark.django_db
+class TestDeprecation:
+ @pytest.mark.parametrize('endpoint', [
+ 'agents',
+ 'creativeworks',
+ 'tags',
+ 'subjects',
+ 'throughtags',
+ 'throughsubjects',
+ 'agents',
+ 'organizations',
+ 'consortiums',
+ 'departments',
+ 'institutions',
+ 'people',
+ 'creativeworks',
+ 'datasets',
+ 'patents',
+ 'posters',
+ 'presentations',
+ 'publications',
+ 'articles',
+ 'books',
+ 'conferencepapers',
+ 'dissertations',
+ 'preprints',
+ 'projects',
+ 'registrations',
+ 'reports',
+ 'theses',
+ 'workingpapers',
+ 'repositories',
+ 'retractions',
+ 'software',
+ 'workidentifiers',
+ 'agentidentifiers',
+ 'agentworkrelations',
+ 'contributors',
+ 'creators',
+ 'principalinvestigators',
+ 'principalinvestigatorcontacts',
+ 'funders',
+ 'hosts',
+ 'publishers',
+ 'throughcontributors',
+ 'awards',
+ 'throughawards',
+ 'workrelations',
+ 'cites',
+ 'compiles',
+ 'corrects',
+ 'discusses',
+ 'disputes',
+ 'documents',
+ 'extends',
+ 'isderivedfrom',
+ 'ispartof',
+ 'issupplementto',
+ 'references',
+ 'repliesto',
+ 'retracts',
+ 'reviews',
+ 'usesdatafroms',
+ 'agentrelations',
+ 'isaffiliatedwith',
+ 'isemployedby',
+ 'ismemberof',
+ ])
+ def test_responds_410(self, client, settings, endpoint):
+ settings.HIDE_DEPRECATED_VIEWS = True
+ resp = client.get(f'/api/v2/{endpoint}/')
+ assert resp.status_code == 410
