From f26fda9485ad119d2047ef1c9b3034225f92e44c Mon Sep 17 00:00:00 2001 From: Michael Shamoon <4887959+shamoon@users.noreply.github.com> Date: Fri, 30 Sep 2022 17:19:54 -0700 Subject: [PATCH] Fix python + frontend tests --- src-ui/cypress/e2e/settings/settings.cy.ts | 2 +- src/documents/tests/test_api.py | 55 ++-------------------- 2 files changed, 6 insertions(+), 51 deletions(-) diff --git a/src-ui/cypress/e2e/settings/settings.cy.ts b/src-ui/cypress/e2e/settings/settings.cy.ts index 7433d16f4..157796a11 100644 --- a/src-ui/cypress/e2e/settings/settings.cy.ts +++ b/src-ui/cypress/e2e/settings/settings.cy.ts @@ -46,7 +46,7 @@ describe('settings', () => { }) }) - cy.viewport(1024, 1024) + cy.viewport(1024, 1280) cy.visit('/settings') cy.wait('@savedViews') }) diff --git a/src/documents/tests/test_api.py b/src/documents/tests/test_api.py index 4fc90b72e..9ad8dd118 100644 --- a/src/documents/tests/test_api.py +++ b/src/documents/tests/test_api.py @@ -1581,7 +1581,11 @@ class TestApiUiSettings(DirectoriesMixin, APITestCase): self.assertEqual(response.status_code, 200) self.assertDictEqual( response.data["settings"], - {}, + { + "update_checking": { + "backend_setting": "default", + }, + }, ) def test_api_set_ui_settings(self): @@ -2542,38 +2546,6 @@ class TestApiRemoteVersion(DirectoriesMixin, APITestCase): def setUp(self): super().setUp() - def test_remote_version_default(self): - response = self.client.get(self.ENDPOINT) - - self.assertEqual(response.status_code, 200) - self.assertDictEqual( - response.data, - { - "version": "0.0.0", - "update_available": False, - "feature_is_set": False, - }, - ) - - @override_settings( - ENABLE_UPDATE_CHECK=False, - ) - def test_remote_version_disabled(self): - response = self.client.get(self.ENDPOINT) - - self.assertEqual(response.status_code, 200) - self.assertDictEqual( - response.data, - { - "version": "0.0.0", - "update_available": False, - "feature_is_set": True, - }, - ) - - @override_settings( - ENABLE_UPDATE_CHECK=True, - ) @mock.patch("urllib.request.urlopen") def test_remote_version_enabled_no_update_prefix(self, urlopen_mock): @@ -2591,13 +2563,9 @@ class TestApiRemoteVersion(DirectoriesMixin, APITestCase): { "version": "1.6.0", "update_available": False, - "feature_is_set": True, }, ) - @override_settings( - ENABLE_UPDATE_CHECK=True, - ) @mock.patch("urllib.request.urlopen") def test_remote_version_enabled_no_update_no_prefix(self, urlopen_mock): @@ -2617,13 +2585,9 @@ class TestApiRemoteVersion(DirectoriesMixin, APITestCase): { "version": version.__full_version_str__, "update_available": False, - "feature_is_set": True, }, ) - @override_settings( - ENABLE_UPDATE_CHECK=True, - ) @mock.patch("urllib.request.urlopen") def test_remote_version_enabled_update(self, urlopen_mock): @@ -2650,13 +2614,9 @@ class TestApiRemoteVersion(DirectoriesMixin, APITestCase): { "version": new_version_str, "update_available": True, - "feature_is_set": True, }, ) - @override_settings( - ENABLE_UPDATE_CHECK=True, - ) @mock.patch("urllib.request.urlopen") def test_remote_version_bad_json(self, urlopen_mock): @@ -2674,13 +2634,9 @@ class TestApiRemoteVersion(DirectoriesMixin, APITestCase): { "version": "0.0.0", "update_available": False, - "feature_is_set": True, }, ) - @override_settings( - ENABLE_UPDATE_CHECK=True, - ) @mock.patch("urllib.request.urlopen") def test_remote_version_exception(self, urlopen_mock): @@ -2698,7 +2654,6 @@ class TestApiRemoteVersion(DirectoriesMixin, APITestCase): { "version": "0.0.0", "update_available": False, - "feature_is_set": True, }, )