From 957599ae01687d6b3d02a3c34fdbe2ac6bd920f9 Mon Sep 17 00:00:00 2001 From: Anike Arni Date: Thu, 16 Feb 2017 18:51:26 -0200 Subject: [#907] Bundles login static files separately Due to conflicts with public and protected urls, login and interstitial files have to be on a different public url from inbox and resources that require login. Therefore, here, we delegate that logic to webpack. Now we have a '/public' url and a '/assets' url for those static assets. --- service/test/unit/resources/test_helpers.py | 7 +++++++ service/test/unit/resources/test_login_resource.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'service/test/unit') diff --git a/service/test/unit/resources/test_helpers.py b/service/test/unit/resources/test_helpers.py index e21c5373..6c456f51 100644 --- a/service/test/unit/resources/test_helpers.py +++ b/service/test/unit/resources/test_helpers.py @@ -18,6 +18,7 @@ from twisted.trial import unittest import re from pixelated.resources import respond_json, respond_json_deferred +from pixelated.resources import get_public_static_folder, get_protected_static_folder from test.unit.resources import DummySite from twisted.web.test.requesthelper import DummyRequest @@ -44,3 +45,9 @@ class TestHelpers(unittest.TestCase): self.assertEqual(b"{\"test\": \"yep\"}", request.written[0]) self.assertEqual([b"application/json"], request.responseHeaders.getRawHeaders("Content-Type")) + + def test_getting_public_folder_returns_path(self): + self.assertIn('web-ui/dist/public', get_public_static_folder()) + + def test_getting_protected_folder_returns_path(self): + self.assertIn('web-ui/dist/protected', get_protected_static_folder()) diff --git a/service/test/unit/resources/test_login_resource.py b/service/test/unit/resources/test_login_resource.py index 29592c1d..bd0f9122 100644 --- a/service/test/unit/resources/test_login_resource.py +++ b/service/test/unit/resources/test_login_resource.py @@ -230,7 +230,7 @@ class TestLoginPOST(unittest.TestCase): def assert_interstitial_in_response(_): mock_authenticate.assert_called_once_with(self.username, self.password) - interstitial_js_in_template = '' + interstitial_js_in_template = '' self.assertIn(interstitial_js_in_template, self.request.written[0]) d.addCallback(assert_interstitial_in_response) -- cgit v1.2.3