mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2024-11-21 23:01:52 +00:00
test file permissions
This commit is contained in:
parent
578f02db2d
commit
18541de371
@ -102,6 +102,33 @@ class PostTests(TestCase):
|
||||
e.save()
|
||||
self.expedition = e
|
||||
|
||||
def test_file_permissions(self):
|
||||
"""Expect to be allowed to write to expofiles
|
||||
Need to login first.
|
||||
"""
|
||||
c = self.client
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
u = User.objects.get(username="expotest")
|
||||
testyear = self.testyear
|
||||
|
||||
self.assertTrue(u.is_active, "User '" + u.username + "' is INACTIVE")
|
||||
c.login(username=u.username, password="secretword")
|
||||
|
||||
for p in [settings.SCANS_ROOT,
|
||||
settings.DRAWINGS_DATA / "walletjson",
|
||||
settings.EXPOWEB / "documents",
|
||||
settings.SURVEX_DATA / "docs"
|
||||
]:
|
||||
|
||||
_test_file_path = pathlib.Path(p, "_created_by_test_suite.txt")
|
||||
self.assertEqual(_test_file_path.is_file(), False)
|
||||
|
||||
with open(_test_file_path, "w") as f:
|
||||
f.write("test string: can we write to this directory?")
|
||||
self.assertEqual(_test_file_path.is_file(), True)
|
||||
#_test_file_path.unlink()
|
||||
|
||||
def test_scan_upload(self):
|
||||
"""Expect scan upload to wallet to work on any file
|
||||
Need to login first.
|
||||
|
Loading…
Reference in New Issue
Block a user