forked from expo/troggle
documn. url reverse() tests
This commit is contained in:
parent
45fcaac47d
commit
94dd0fe1fd
@ -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/
|
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.
|
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
|
This is the template synstax for
|
||||||
reverse('THING')
|
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
|
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.
|
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
|
1. No tests: No parameters
|
||||||
|
|
||||||
{% url "caveindex" %}
|
{% url "caveindex" %}
|
||||||
|
Loading…
Reference in New Issue
Block a user