summaryrefslogtreecommitdiffstats
path: root/core/TESTS/tests_logins.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@klebos.com>2022-08-25 14:38:14 +0300
committerPhilip Sargent <philip.sargent@klebos.com>2022-08-25 14:38:14 +0300
commit8f03e590cc3cf285d1a5d53bb495c01f06d00c79 (patch)
treeb937d156920ac2f1054fd15b8f5ccfbe8e2e60b1 /core/TESTS/tests_logins.py
parent57c4732566b0faad1ba35e3f7cdfd9693d65f54f (diff)
downloadtroggle-8f03e590cc3cf285d1a5d53bb495c01f06d00c79.tar.gz
troggle-8f03e590cc3cf285d1a5d53bb495c01f06d00c79.tar.bz2
troggle-8f03e590cc3cf285d1a5d53bb495c01f06d00c79.zip
update test to match new wallet json location
Diffstat (limited to 'core/TESTS/tests_logins.py')
-rw-r--r--core/TESTS/tests_logins.py19
1 files changed, 15 insertions, 4 deletions
diff --git a/core/TESTS/tests_logins.py b/core/TESTS/tests_logins.py
index 7b47365..4fcaac3 100644
--- a/core/TESTS/tests_logins.py
+++ b/core/TESTS/tests_logins.py
@@ -11,6 +11,7 @@ import pathlib
from http import HTTPStatus
from django.test import TestCase, SimpleTestCase, TransactionTestCase, Client
+from troggle.core.models.survex import Wallet
import troggle.settings as settings
@@ -43,7 +44,7 @@ class FixturePageTests(TestCase):
def setUp(self):
from django.contrib.auth.models import User
self.user = User.objects.get(username='expotest')
-
+
def tearDown(self):
pass
@@ -77,15 +78,25 @@ class PostTests(TestCase):
from django.contrib.auth.models import User
self.user = User.objects.get(username='expotest')
self.client = Client()
+
+ wname = "2020#00"
+ w = Wallet()
+ w.pk = 9100
+ w.fpath = str(pathlib.Path(settings.SCANS_ROOT, wname))
+ w.walletname = wname
+ w.save()
+ self.wallet = w
+
def test_scan_upload(self):
'''Expect scan upload to wallet to work on any file
Need to login first.
- This upload form looks for the cave, so the test fails if the database is not loaded with the cave
+ This upload form looks for the Cave and the Wallet, so the test fails if the database is not loaded with the cave
identified in the wallet
'''
c = self.client
+ w = self.wallet
from django.contrib.auth.models import User
u = User.objects.get(username='expotest')
@@ -97,8 +108,8 @@ class PostTests(TestCase):
content = response.content.decode()
self.assertEqual(response.status_code, 200)
self.assertEqual(response.status_code, HTTPStatus.OK)
- # with open('_test_response.html', 'w') as f:
- # f.write(content)
+ with open('_test_response.html', 'w') as f:
+ f.write(content)
for ph in [ r'test_upload_',
r'&larr; 2020#00 &rarr;',
r'description written',