documn. url reverse() tests

This commit is contained in:
Philip Sargent 2023-03-12 23:40:11 +00:00
parent 45fcaac47d
commit 94dd0fe1fd

View File

@ -6,6 +6,16 @@ so any path that relies on data being in the database will fail.
https://docs.djangoproject.com/en/dev/topics/testing/tools/
We are not using
https://github.com/FactoryBoy/factory_boy
because we are trying to minimise the number of 3rd-party packages because they expose us to update hell,
as experience in 2019-2020.
However we could use
https://docs.python.org/dev/library/unittest.mock.html
as this is now part if python - if we can get our heads around it.
The tests in this file:
The code {% url THING %} or {% url THING PARAMETER %} appears a hundred times or more in the troggle/templates/ HTML template files.
This is the template synstax for
reverse('THING')
@ -18,6 +28,8 @@ parameters should be fine as this is fundamental Django stuff which will have be
But the reverse() function is purely syntactical, the PARAMETER is just a string which is applied to
the url. So this is not testing anything important really. See the test_url_threed() below.
These url lines all come from templates/*.html
1. No tests: No parameters
{% url "caveindex" %}