def test_past_datetime(self):
        value = self.sd.past_datetime()
        self.assertTrue(isinstance(value, datetime.datetime))

        self.assertTrue(value <= datetime.datetime.utcnow().replace(tzinfo=utc))
        self.assertTrue(value >= (datetime.timedelta(minutes=1440) - datetime.datetime.utcnow().replace(tzinfo=utc)))

        value = self.sd.past_datetime(0, 10)
        self.assertTrue(value <= datetime.datetime.utcnow().replace(tzinfo=utc))
        self.assertTrue(value >= (datetime.datetime.utcnow().replace(tzinfo=utc) - datetime.timedelta(minutes=10)))

        with self.assertRaises(ParameterError):
            self.sd.past_datetime(100, 0)

        with self.assertRaises(ParameterError):
            self.sd.past_datetime(-10, 10)
dataset/ETHPy150Open kaleidos/django-sampledatahelper/tests/tests.py/TestTimeHelpers.test_past_datetime/swapped operands of `-`