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

delete test upload file after test

This commit is contained in:
2023-03-22 17:57:48 +00:00
parent 5f46d8fdc5
commit dd32114698
2 changed files with 5 additions and 5 deletions

View File

@@ -151,7 +151,6 @@ class PostTests(TestCase):
)
content = response.content.decode()
self.assertEqual(response.status_code, HTTPStatus.OK)
self.assertEqual(response.status_code, HTTPStatus.OK)
with open("_test_response.html", "w") as f:
f.write(content)
for ph in [
@@ -165,9 +164,10 @@ class PostTests(TestCase):
self.assertIsNotNone(phmatch, "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.SCANS_ROOT) / f'{testyear}' / f'{testyear}#00'/ 'test_upload_file.txt'
# remove_file.unlink()
# # Undo the auto create and commit of a new wallet
remove_file = pathlib.Path(settings.SCANS_ROOT) / f'{testyear}' / f'{testyear}#00'/ 'test_upload_file.txt'
remove_file.unlink()
# # Undo the auto create and commit of a new wallet. Why is the commit not happening when we run the test?
# cwd = settings.DRAWINGS_DATA
# sp = subprocess.run([settings.GIT, "reset", "--hard", "master^"], cwd=cwd, capture_output=True, text=True)
# print(f'git output: {cwd}:\n # {sp.stderr=}\n # {sp.stdout=} \n # return code: {str(sp.returncode)}')