summaryrefslogtreecommitdiffstats
path: root/core/TESTS/test_urls.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2023-03-12 23:40:11 +0000
committerPhilip Sargent <philip.sargent@gmail.com>2023-03-12 23:40:11 +0000
commit94dd0fe1fda371d7f1977764cd4badfb8f156973 (patch)
tree6c71fd6232de223b85b98702b4469af31a34a8a0 /core/TESTS/test_urls.py
parent45fcaac47d2fefd5ab764c1be88a896a2ac6be9a (diff)
downloadtroggle-94dd0fe1fda371d7f1977764cd4badfb8f156973.tar.gz
troggle-94dd0fe1fda371d7f1977764cd4badfb8f156973.tar.bz2
troggle-94dd0fe1fda371d7f1977764cd4badfb8f156973.zip
documn. url reverse() tests
Diffstat (limited to 'core/TESTS/test_urls.py')
-rw-r--r--core/TESTS/test_urls.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/core/TESTS/test_urls.py b/core/TESTS/test_urls.py
index df34ee6..7af8efc 100644
--- a/core/TESTS/test_urls.py
+++ b/core/TESTS/test_urls.py
@@ -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" %}