From 00eb978f5fb043b6fe50e5a5988fde3ec4d3c488 Mon Sep 17 00:00:00 2001 From: Philip Sargent <philip.sargent@klebos.com> Date: Wed, 20 Apr 2022 21:22:38 +0300 Subject: [PATCH] fixed test broken by recent update --- .gitignore | 1 + core/TESTS/tests_logins.py | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 742d605..0e3f13b 100644 --- a/.gitignore +++ b/.gitignore @@ -125,3 +125,4 @@ media/jslib/openlayers/Lang/te.js media/jslib/openlayers/Lang/vi.js media/jslib/openlayers/Lang/zh-CN.js media/jslib/openlayers/Lang/zh-TW.js +_test_response.html diff --git a/core/TESTS/tests_logins.py b/core/TESTS/tests_logins.py index 513e69d..c6cf962 100644 --- a/core/TESTS/tests_logins.py +++ b/core/TESTS/tests_logins.py @@ -202,14 +202,14 @@ class PostTests(TestCase): with open('core/fixtures/test_upload_nosuffix','r') as testf: response = self.client.post('/dwguploadnogit/uploads', data={'name': 'test_upload_nosuffix', 'uploadfiles': testf }) content = response.content.decode() - # with open('_test_response.html', 'w') as f: - # f.write(content) + with open('_test_response.html', 'w') as f: + f.write(content) self.assertEqual(response.status_code, 200) - for ph in [ r'Upload more', - r' saved as ', + for ph in [ r'test_upload_nosuffix', + r'You cannot create folders here', r'Clicking on a filename only']: phmatch = re.search(ph, content) - self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph +"'") + self.assertIsNotNone(phmatch, "Expect no-suffix file to upload OK. Failed to find expected text: '" + ph +"'") # Does not use the filename Django actually uses, assumes it is unchanged. Potential bug. remove_file = pathlib.Path(settings.DRAWINGS_DATA) / 'uploads' / 'test_upload_nosuffix'