Open
Conversation
alvinsiu
requested changes
Nov 10, 2022
|
|
||
| urlpatterns += [ | ||
| url(r'^__debug__/', include(debug_toolbar.urls)), | ||
| re_path(r'^__debug__/', include(debug_toolbar.urls)), |
Member
There was a problem hiding this comment.
I think path might be more appropriate (and remove the regex components): https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#add-the-urls
Comment on lines
+6
to
7
| pytest | ||
| {%- if cookiecutter.feature_annotations == "on" %} |
Member
There was a problem hiding this comment.
I think we also need pytest-django
Comment on lines
+7
to
+18
| class TestClass: | ||
|
|
||
| @pytest.mark.parametrize( | ||
| "url_name, url, view_class", | ||
| [ | ||
| ("index", "/", views.IndexView), | ||
| ], | ||
| ) | ||
| def test_urls(self, url_name, url, view_class): | ||
| resolver = resolve(url) | ||
| assert resolver.view_name == url_name | ||
| assert resolver.func.view_class == view_class |
Member
There was a problem hiding this comment.
This definitely handles the use case of giving people a sample to follow, but it would be more ideal to have a sample that 1. uses the database, and 2. tests something that is code we've written and not django code
Maybe we can create a new view that uses LoginRequiredMixin and test access that requires the use of factories and making database calls?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There are still warnings present
RemovedInDjango41Warning: 'django_extensions' defines default_app_config = 'django_extensions.apps.DjangoExtensionsConfig'. Django now detects this configuration automatically. You can remove default_app_config.It seems to be that two packages that we use (
django_extensionsandwebpack_loader) definedefault_app_config, which is not needed anymore. We might have to wait for a new version for them to remove itResolves #29