示例#1
0
 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)
示例#2
0
 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)
示例#3
0
    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
示例#4
0
    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
示例#5
0
 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"])