From dc3379c1862219f02dbb697b201ada7f2027e808 Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Tue, 4 May 2021 15:48:11 +0100 Subject: [PATCH] fix end slash issue --- README.txt | 2 +- core/TESTS/tests.py | 10 ++++++++++ urls.py | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/README.txt b/README.txt index 9480f9b..091cccf 100644 --- a/README.txt +++ b/README.txt @@ -65,7 +65,7 @@ We are now using Django 2.2.19 Read this: https://docs.djangoproject.com/en/3.0/topics/install/ -We are installing with python3.7.3 +We are installing with python3.7 Also : https://linuxize.com/post/how-to-install-pip-on-ubuntu-20.04/ ] Install Django using pip, not with apt, on your test system. diff --git a/core/TESTS/tests.py b/core/TESTS/tests.py index b8340c2..7f254c8 100644 --- a/core/TESTS/tests.py +++ b/core/TESTS/tests.py @@ -401,6 +401,16 @@ class PageTests(TestCase): self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph +"'") def test_page_dwgallfiles_empty(self): + # this gets an empty page as the database has not been loaded + response = self.client.get('/dwgfiles') + self.assertEqual(response.status_code, 200) + content = response.content.decode() + for ph in [ r'All Tunnel and Therion files', + r'Scans folderScan filesFrames']: + phmatch = re.search(ph, content) + self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph +"'") + + def test_page_dwgallfiles_empty_slash(self): # this gets an empty page as the database has not been loaded response = self.client.get('/dwgfiles/') self.assertEqual(response.status_code, 200) diff --git a/urls.py b/urls.py index 7df80dd..8e4ccfe 100644 --- a/urls.py +++ b/urls.py @@ -157,6 +157,7 @@ trogglepatterns = [ # The tunnel and therion drawings files pages path('dwgfiles', dwgallfiles, name="dwgallfiles"), + path('dwgfiles/', dwgallfiles, name="dwgallfiles"), path('dwgdataraw/', dwgfilesingle, name="dwgfilesingle"), # path('dwgdataraw//upload', dwgfileupload, name="dwgfileupload"), # Not working