Open crosspolar opened 2 months ago
Shortly after midnight, Github Actions fails the testing-workflow here:
=================================== FAILURES =================================== ______________________ TestShareOwnerList.test_has_status ______________________ self = <tapir.coop.tests.test_share_owner_list_filters.TestShareOwnerList testMethod=test_has_status> def test_has_status(self): share_owners_with_status_sold = [ ShareOwnerFactory.create(), TapirUserFactory.create().share_owner, ] for share_ownership in ShareOwnership.objects.filter( share_owner__in=share_owners_with_status_sold ): share_ownership.end_date = timezone.now() - datetime.timedelta(days=1) share_ownership.save() share_owners_with_status_investing = [ ShareOwnerFactory.create(), TapirUserFactory.create().share_owner, ] for share_owner in share_owners_with_status_investing: share_owner.is_investing = True share_owner.save() share_owners_with_status_active = [ ShareOwnerFactory.create(), TapirUserFactory.create().share_owner, ] for share_owner in share_owners_with_status_active: share_owner.is_investing = False share_owner.save() > self.visit_view( {"status": MemberStatus.SOLD}, must_be_in=share_owners_with_status_sold, must_be_out=share_owners_with_status_investing + share_owners_with_status_active, ) tapir/coop/tests/test_share_owner_list_filters.py:288: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tapir/coop/tests/test_share_owner_list_filters.py:40: in visit_view self.assertIn( E AssertionError: <ShareOwner: ShareOwner object (243)> not found in <django_tables2.data.TableQuerysetData object at 0x7f68ae6a9700> : Lindsey Hinton #243 should show up in the list filtered by status=sold.
Some hours later it's fine again. I assume it's some timezone and datetime problem
Interesting 😅 We'd need to mock the time instead of doing this relative to the actual time.
Shortly after midnight, Github Actions fails the testing-workflow here:
Some hours later it's fine again. I assume it's some timezone and datetime problem