mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-02-18 05:00:13 +00:00
update test to match new wallet json location
This commit is contained in:
parent
57c4732566
commit
8f03e590cc
@ -11,6 +11,7 @@ import pathlib
|
|||||||
from http import HTTPStatus
|
from http import HTTPStatus
|
||||||
|
|
||||||
from django.test import TestCase, SimpleTestCase, TransactionTestCase, Client
|
from django.test import TestCase, SimpleTestCase, TransactionTestCase, Client
|
||||||
|
from troggle.core.models.survex import Wallet
|
||||||
|
|
||||||
import troggle.settings as settings
|
import troggle.settings as settings
|
||||||
|
|
||||||
@ -78,14 +79,24 @@ class PostTests(TestCase):
|
|||||||
self.user = User.objects.get(username='expotest')
|
self.user = User.objects.get(username='expotest')
|
||||||
self.client = Client()
|
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):
|
def test_scan_upload(self):
|
||||||
'''Expect scan upload to wallet to work on any file
|
'''Expect scan upload to wallet to work on any file
|
||||||
Need to login first.
|
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
|
identified in the wallet
|
||||||
'''
|
'''
|
||||||
c = self.client
|
c = self.client
|
||||||
|
w = self.wallet
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
u = User.objects.get(username='expotest')
|
u = User.objects.get(username='expotest')
|
||||||
|
|
||||||
@ -97,8 +108,8 @@ class PostTests(TestCase):
|
|||||||
content = response.content.decode()
|
content = response.content.decode()
|
||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
self.assertEqual(response.status_code, HTTPStatus.OK)
|
self.assertEqual(response.status_code, HTTPStatus.OK)
|
||||||
# with open('_test_response.html', 'w') as f:
|
with open('_test_response.html', 'w') as f:
|
||||||
# f.write(content)
|
f.write(content)
|
||||||
for ph in [ r'test_upload_',
|
for ph in [ r'test_upload_',
|
||||||
r'← 2020#00 →',
|
r'← 2020#00 →',
|
||||||
r'description written',
|
r'description written',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user