2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-15 23:07:07 +00:00

bugfix in photo upload, untidy

This commit is contained in:
Philip Sargent
2022-08-11 23:35:53 +03:00
parent e35616a611
commit 1bbfd1e517
2 changed files with 24 additions and 15 deletions

View File

@@ -206,12 +206,12 @@ 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'test_upload_nosuffix',
r'You cannot create folders here',
r'Clicking on a filename only']:
r'Creating a folder is done by a nerd']:
phmatch = re.search(ph, content)
self.assertIsNotNone(phmatch, "Expect no-suffix file to upload OK. Failed to find expected text: '" + ph +"'")