def test_watch_toggle_offer(self): offer = test_data.create_dummy_offer() user = offer.issue.createdByUser self.assertTrue(not watch_services.is_watching_offer(user, offer.id)) watch_services.watch_offer(user, offer.id, OfferWatch.WATCHED) self.assertTrue(watch_services.is_watching_offer(user, offer.id)) watch_services.unwatch_offer(user, offer.id) self.assertTrue(not watch_services.is_watching_offer(user, offer.id))
def test_watch_toggle_offer(self): offer = test_data.create_dummy_offer_usd() user = offer.issue.createdByUser self.assertTrue(not watch_services.is_watching_offer(user, offer.id)) watch_services.watch_offer(user, offer.id, OfferWatch.WATCHED) self.assertTrue(watch_services.is_watching_offer(user, offer.id)) watch_services.unwatch_offer(user, offer.id) self.assertTrue(not watch_services.is_watching_offer(user, offer.id))
def unwatchOffer(request, offer_id): watch_services.unwatch_offer(request.user, int(offer_id)) return HttpResponse('NOT_WATCHING')