From fe8ec942f4b0e2d0b938814541f2fca5f6d77d78 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Jan 10 2020 08:55:42 +0000 Subject: frontend: fix testsuite broken by a34ad40c260e8e61 I'm not 100% sure now that the cached value wouldn't bite us in future; such problems would be hard to debug. --- diff --git a/frontend/coprs_frontend/coprs/models.py b/frontend/coprs_frontend/coprs/models.py index e64db96..9f7e0e6 100644 --- a/frontend/coprs_frontend/coprs/models.py +++ b/frontend/coprs_frontend/coprs/models.py @@ -1023,12 +1023,6 @@ class Build(db.Model, helpers.Serializer): @property def status(self): - if getattr(self, '_cached_status_set') is None: - self._cached_status = self._status() - self._cached_status_set = True - return self._cached_status - - def _status(self): """ Return build status. """ diff --git a/frontend/coprs_frontend/tests/test_views/test_backend_ns/test_backend_general.py b/frontend/coprs_frontend/tests/test_views/test_backend_ns/test_backend_general.py index 7bf799c..6537edb 100644 --- a/frontend/coprs_frontend/tests/test_views/test_backend_ns/test_backend_general.py +++ b/frontend/coprs_frontend/tests/test_views/test_backend_ns/test_backend_general.py @@ -317,7 +317,9 @@ class TestUpdateActions(CoprsTestCase): ] }""" - def test_update_one_action(self, f_users, f_coprs, f_actions, f_db): + @mock.patch('coprs.logic.actions_logic.time.time') + def test_update_one_action(self, mc_time, f_users, f_coprs, f_actions, f_db): + mc_time.return_value = 1390866440 r = self.tc.post("/backend/update/", content_type="application/json", headers=self.auth_header,