def test_inactive_subscription(self): self.sub.active = False self.sub.save() self.mocks['pay'].delete.return_value = successful_method() self.buyer.close()
def test_close(self): self.mocks['pay'].delete.return_value = successful_method() self.mocks['sub'].cancel.return_value = successful_subscription() self.buyer.close() self.mocks['pay'].delete.assert_called_with(self.method.provider_id) self.mocks['sub'].cancel.assert_called_with(self.sub.provider_id) eq_(self.method.reget().active, False) eq_(self.sub.reget().active, False)
def test_listens_signal(self): self.mocks['pay'].delete.return_value = successful_method() self.mocks['sub'].cancel.return_value = successful_subscription() self.buyer.close_signal.send(buyer=self.buyer, sender=self.buyer.__class__)
def test_listens_signal(self): self.mocks['pay'].delete.return_value = successful_method() self.mocks['sub'].cancel.return_value = successful_subscription() self.buyer.close_signal.send( buyer=self.buyer, sender=self.buyer.__class__)