@override_settings(USE_TZ=True)
    @override_settings(TIME_ZONE='Asia/Shanghai')
    def test_use_timezone(self):
        from_user = User.objects.create(username="from", password="pwd", email="example@example.com")
        to_user = User.objects.create(username="to", password="pwd", email="example@example.com")
        notify.send(from_user, recipient=to_user, verb='commented', action_object=from_user)
        notification = Notification.objects.get(recipient=to_user)
        delta = localtime(notification.timestamp, pytz.timezone(settings.TIME_ZONE)) - timezone.now().replace(tzinfo=utc)
        self.assertTrue(delta.seconds < 60)
        # The delta between the two events will still be less than a second despite the different timezones
        # The call to now and the immediate call afterwards will be within a short period of time, not 8 hours as the
        # test above was originally.
dataset/ETHPy150Open django-notifications/django-notifications/notifications/tests/tests.py/NotificationTest.test_use_timezone/swapped operands of `-`