def test_api_endpoint(active_user): '''Test version API endpoint.''' # see test_dataset.py, test_dataset_download_url client = APIClient() client.force_authenticate(user=active_user) url = '/api/version/{}' response = client.get(url) assert (response.data['version'] == __version__) if have_vcs(): assert (response.data['vcs_version'] == vcs_version()) assert (response.data['updated'] == vcs_timestamp()) assert (response.data['revision'] == vcs_revision())
def test_have_vcs(): '''Test the have_vcs method of version.py.''' vcs_value = _vcs_path() assert((vcs_value is not None) == have_vcs())