(self)
| 938 | assert tb.restore_group(tid) == res |
| 939 | |
| 940 | def test_cleanup(self): |
| 941 | tb = DatabaseBackend(self.uri, app=self.app) |
| 942 | for i in range(10): |
| 943 | tb.mark_as_done(uuid(), 42) |
| 944 | tb.save_group(uuid(), {'foo': 'bar'}) |
| 945 | s = tb.ResultSession() |
| 946 | for t in s.query(Task).all(): |
| 947 | t.date_done = datetime.now() - tb.expires * 2 |
| 948 | for t in s.query(TaskSet).all(): |
| 949 | t.date_done = datetime.now() - tb.expires * 2 |
| 950 | s.commit() |
| 951 | s.close() |
| 952 | |
| 953 | tb.cleanup() |
| 954 | |
| 955 | def test_cleanup_respects_timezone_for_expiration(self): |
| 956 | """Regression test for timezone bug where cleanup uses app.now() while date_done is UTC.""" |
nothing calls this directly
no test coverage detected