summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/TESTS/tests_logins.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/core/TESTS/tests_logins.py b/core/TESTS/tests_logins.py
index 0e6da96..81ba976 100644
--- a/core/TESTS/tests_logins.py
+++ b/core/TESTS/tests_logins.py
@@ -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.