def METHOD_NAME(self):
    self.instance.write(dict(comparison_mode=True, date="2019-05-03"))
    self.period.write(dict(mode=MODE_REL, type="d", offset="-2", is_ytd=True))
    self.assertDateEqual(self.period.date_from, "2019-01-01")
    self.assertDateEqual(self.period.date_to, "2019-05-01")
    self.assertTrue(self.period.valid)