def test_remove_availability(self): c = logged_in_client() available_event = EventObject.objects.filter( event_type="availability")[0] event_id = available_event.id response = c.post("/admin/remove/availability", {"id": event_id}) response_check = verify_json_response(response.content, settings.APP_CODE["DELETED"]) self.assertTrue(response_check)
def test_remove_availability(self): c = logged_in_client() available_event = EventObject.objects.filter( event_type="availability")[0] event_id = available_event.id response = c.post("/admin/remove/availability",{"id":event_id}) response_check = verify_json_response( response.content, settings.APP_CODE["DELETED"]) self.assertTrue(response_check)
def test_calendar_save(self): c = Client() cal_event = {"event_type": "availability", "start": "Mon Oct 08 2012 00:00:00", "end": "Mon Oct 09 2012 00:00:00"} response = c.post("/admin/save/availability", cal_event) response_check = verify_json_response(response.content, settings.APP_CODE["SAVED"]) self.assertTrue(response_check) response = c.get("/admin/available/time") print response.content
def test_calendar_save(self): c = Client() cal_event = { "event_type": "availability", "start": "Mon Oct 08 2012 00:00:00", "end": "Mon Oct 09 2012 00:00:00" } response = c.post("/admin/save/availability", cal_event) response_check = verify_json_response(response.content, settings.APP_CODE["SAVED"]) self.assertTrue(response_check) response = c.get("/admin/available/time") print response.content
def test_seller_rejection(self): """ Atleast one pending account needed for this test """ c = logged_in_client() seller_request = SellerRequest.objects.filter( status=settings.SELLER_REQUEST_STATUS["PENDING"])[0] approval = {"decision": settings.SELLER_REQUEST_STATUS["REJECTED"], "seller_request_id": seller_request.id} response = c.post("/admin/seller/request/decision", approval) response_check = verify_json_response(response.content, settings.APP_CODE["CALLBACK"]) self.assertTrue(response_check["code"]) self.assertEqual(response_check["data"]["request_status"], settings.SELLER_REQUEST_STATUS["REJECTED"])