Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests to check the validity of the list of endpoints #261

Open
hmpf opened this issue Jan 28, 2021 · 2 comments · May be fixed by #263
Open

Add tests to check the validity of the list of endpoints #261

hmpf opened this issue Jan 28, 2021 · 2 comments · May be fixed by #263
Assignees
Labels
API Affects Argus' REST API tests Requires automated tests / affects test framework

Comments

@hmpf
Copy link
Contributor

hmpf commented Jan 28, 2021

During a merge of a long-lived branch, the path to an endpoint disappeared from an urls.py meaning an endpoint actively in use became unreachable.

Checking that an endpoint has a path is quite cheap, as seen by the django_extension command show_urls, so we should have a unit-test to ensure this doesn't happen again.

@hmpf hmpf added API Affects Argus' REST API tests Requires automated tests / affects test framework labels Jan 28, 2021
@hmpf
Copy link
Contributor Author

hmpf commented Feb 1, 2021

The obvious way to do this, bu using django.urls.resolve(), hangs on a bug in Django: https://code.djangoproject.com/ticket/32402

@hmpf hmpf added the blocked Another thing/issue has to be resolved before tackling this label Feb 1, 2021
@hmpf hmpf linked a pull request Feb 1, 2021 that will close this issue
@hmpf hmpf removed the blocked Another thing/issue has to be resolved before tackling this label Feb 1, 2021
@hmpf
Copy link
Contributor Author

hmpf commented Feb 1, 2021

The ticket with Django has been closed: resolve() is not to be used to look up urlpatterns even though you might think so from the docs.

Therefore, for our test we will need to create our own recursive walker of the urlconf.

@hmpf hmpf self-assigned this Nov 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Affects Argus' REST API tests Requires automated tests / affects test framework
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant