summaryrefslogtreecommitdiffstats
path: root/core/TESTS/test_logins.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2023-03-22 23:29:40 +0000
committerPhilip Sargent <philip.sargent@gmail.com>2023-03-22 23:29:40 +0000
commit2332bfdc577f47e407c9278e834362c040b9a0c2 (patch)
tree76f68c8efb8d6918b235561ec6083627702c4227 /core/TESTS/test_logins.py
parent1db7c5ffeafd9fd1f3f0a9c9de6a9d0e456a4364 (diff)
downloadtroggle-2332bfdc577f47e407c9278e834362c040b9a0c2.tar.gz
troggle-2332bfdc577f47e407c9278e834362c040b9a0c2.tar.bz2
troggle-2332bfdc577f47e407c9278e834362c040b9a0c2.zip
comment to resolve confusion
Diffstat (limited to 'core/TESTS/test_logins.py')
-rw-r--r--core/TESTS/test_logins.py24
1 files changed, 13 insertions, 11 deletions
diff --git a/core/TESTS/test_logins.py b/core/TESTS/test_logins.py
index e17ad43..7bfd065 100644
--- a/core/TESTS/test_logins.py
+++ b/core/TESTS/test_logins.py
@@ -163,16 +163,13 @@ class PostTests(TestCase):
phmatch = re.search(ph, content)
self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph + "'")
- # # Does not use the filename Django actually uses, assumes it is unchanged. Potential bug.
+ # Does not use the filename Django actually uses, assumes it is unchanged. Bug: accumulates one file with random name
+ # added each time it is run. The name of the uploaded file is only available within the code where it happens
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)}')
- # if sp.returncode != 0:
- # print(f'git output: {cwd}:\n # {sp.stderr=}\n # {sp.stdout=} \n # return code: {str(sp.returncode)}')
+ # Just uploading a file does NOT do any git commit.
+ # You need to create or edit a contents.json file for that to happen.
def test_photo_upload(self):
"""Expect photo upload to work on any file (contrary to msg on screen)
@@ -207,7 +204,8 @@ class PostTests(TestCase):
phmatch = re.search(ph, content)
self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph + "'")
- # Does not use the filename Django actually uses, assumes it is unchanged. Potential bug.
+ # Does not use the filename Django actually uses, assumes it is unchanged. Bug: accumulates one file with random name
+ # added each time it is run. The name of the uploaded file is only available within the code where it happens
remove_file = pathlib.Path(settings.PHOTOS_ROOT, settings.PHOTOS_YEAR) / "test_upload_file.txt"
remove_file.unlink()
@@ -239,7 +237,8 @@ class PostTests(TestCase):
phmatch = re.search(ph, content)
self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph + "'")
- # Does not use the filename Django actually uses, assumes it is unchanged. Potential bug.
+ # Does not use the filename Django actually uses, assumes it is unchanged. Bug: accumulates one file with random name
+ # added each time it is run. The name of the uploaded file is only available within the code where it happens
remove_file = pathlib.Path(settings.PHOTOS_ROOT, settings.PHOTOS_YEAR) / rename
remove_file.unlink()
@@ -267,7 +266,8 @@ class PostTests(TestCase):
phmatch = re.search(ph, content)
self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph + "'")
- # Does not use the filename Django actually uses, assumes it is unchanged. Potential bug.
+ # Does not use the filename Django actually uses, assumes it is unchanged. Bug: accumulates one file with random name
+ # added each time it is run. The name of the uploaded file is only available within the code where it happens
remove_dir = pathlib.Path(settings.PHOTOS_ROOT, settings.PHOTOS_YEAR) / "GussieFinkNottle"
remove_dir.rmdir()
@@ -323,7 +323,9 @@ class PostTests(TestCase):
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. Bug: accumulates one file with random name added each time it is run.
+ # Does not use the filename Django actually uses, assumes it is unchanged. Bug: accumulates one file with random name
+ # added each time it is run. The name of the uploaded file is only available within the code where it happens
+ # UploadedFile.name see https://docs.djangoproject.com/en/4.1/ref/files/uploads/#django.core.files.uploadedfile.UploadedFile
remove_file = pathlib.Path(settings.DRAWINGS_DATA) / "uploads" / "test_upload_nosuffix"
remove_file.unlink()