def test_generate_picks_up_on_publish(self): self.publishable.publish_from = timezone.now() + timedelta(days=1) self.publishable.save() self._signal_clear() generate_publish_signals(timezone.now() + timedelta(days=1, seconds=2)) tools.assert_equals(1, len(self.publish_received)) tools.assert_equals(0, len(self.unpublish_received)) tools.assert_equals(self.publishable, self.publish_received[0]['publishable'].target)
def test_generate_picks_up_on_takedown(self): self.publishable.publish_to = datetime.now() + timedelta(days=1) self.publishable.save() self._signal_clear() generate_publish_signals(datetime.now() + timedelta(days=1, seconds=2)) tools.assert_equals(0, len(self.publish_received)) tools.assert_equals(1, len(self.unpublish_received)) tools.assert_equals(self.publishable, self.unpublish_received[0]["publishable"].target)
def test_generate_doesnt_issue_signal_tice(self): self._signal_clear() generate_publish_signals() tools.assert_equals(0, len(self.publish_received)) tools.assert_equals(0, len(self.unpublish_received))
def handle_noargs(self, **options): generate_publish_signals()