def testDeleteReturnsRequestAlreadyMatchedError(self):
        """
        Test that trying to delete ride request that is already matched would return an error
        :return:
        """
        for userId in self.userIds:
            form = FormDictFactory().create(returnDict=True)
            form["flightLocalTime"] = "2018-12-20T12:00:00.000"
            form["testUserId"] = userId
            r = self.app.post(  # TODO: change everywhere to json=form (used to be json=json.dumps(form))
                path='/rideRequests', json=form, headers=getMockAuthHeaders(userId))
            print(r.json)
            # self.assertRaises(service_errors.RequestAlreadyExistsError)
            firestore_ref = r.json["firestoreRef"]  # Not that it is actually rideRequestId
            self.ride_request_ids_to_unmatch.append((userId, firestore_ref))
            self.ride_request_ids_to_delete.append((userId, firestore_ref))

        uid, rid = self.ride_request_ids_to_delete[0]

        r = self.app.post(path='/devForceMatch',
                          json=json.dumps({"operationMode": "two",
                                           "rideRequestIds": [i[1] for i in self.ride_request_ids_to_delete]
                                           })
                          )
        r = self.app.delete(path='/rideRequests' + '/' + rid,
                            headers=getMockAuthHeaders(uid=uid)
                            )
        error_return_expected = {
            "message": "Ride request has requestCompletion as True. Un-match from an orbit first. ",
            "status": 500
        }
        error_message_expected = error_return_expected["message"]
        error_status_code_expected = error_return_expected["status"]
        self.assertEqual(r.json["message"], error_message_expected)
        self.assertEqual(r.status_code, error_status_code_expected)
    def testRaiseRequestAlreadyExistsError(self):
        # Create new rideRequests
        for userId in self.userIds:
            form = FormDictFactory().create(returnDict=True)
            form["flightLocalTime"] = "2018-12-20T12:00:00.000"
            form["testUserId"] = userId
            r = self.app.post(  # TODO: change everywhere to json=form (used to be json=json.dumps(form))
                path='/rideRequests', json=form, headers=getMockAuthHeaders(userId))
            print(r.json)
            # self.assertRaises(service_errors.RequestAlreadyExistsError)
            # self.assertIn("firestoreRef", r.json.keys())
            firestore_ref = r.json["firestoreRef"]  # Not that it is actually rideRequestId
            self.ride_request_ids_to_delete.append((userId, firestore_ref))

        userId = self.userIds[0]
        r = self.app.post(  # TODO: change everywhere to json=form (used to be json=json.dumps(form))
            path='/rideRequests', json=form, headers=getMockAuthHeaders(userId))
        print(r.json)
        error_return_expected = {
                "message": "Ride request on the same day (or for the same event) already exists",
                "status": 400
            }
        error_message_expected = error_return_expected["message"]
        error_status_code_expected = error_return_expected["status"]
        self.assertEqual(r.json["message"], error_message_expected)
        self.assertEqual(r.status_code, error_status_code_expected)
示例#3
0
    def testGet(self):
        """
        NOTE: implementation in progress
        TODO: implement
        :return:
        """
        r = self.app.get(path='/rideRequests' + '/' + self.rideRequestId,
                         headers=getMockAuthHeaders())

        orbit_dict = {
            "orbitCategory": "airportRide",
            "eventRef": "testeventref1",
            "userTicketPairs": {},
            "chatroomRef": "testchatroomref1",
            "costEstimate": 987654321,
            "status": 1
        }

        assert r.status_code == 200
        # orbit_id = result["orbitId"]

        r = self.app.get(path='/rideRequests' + '/' + self.rideRequestId +
                         '/orbit',
                         headers=getMockAuthHeaders())

        result = dict(r.json)

        # self.assertIsNotNone(result["locationId"])
        # self.assertIsNotNone(result["eventId"])
        # self.assertIsNone(result["orbitId"])
        # self.assertEqual(r.status_code, 200)
        self.assertDictContainsSubset(orbit_dict, result)
示例#4
0
 def test_post_twice(self):
     """
     Test that posting the same event twice returns the same id
     :return:
     """
     fb_dict = {
         "description": "Advance Sale begins Friday, 6/1 at 11AM PDT\nwww.coachella.com",
         "end_time": "2019-04-14T23:59:00-0700",
         "name": "Coachella Valley Music and Arts Festival 2019 - Weekend 1",
         "place": {
             "name": "Coachella",
             "location": {
                 "latitude": 33.679974,
                 "longitude": -116.237221
             },
             "id": "20281766647"
         },
         "start_time": "2019-04-12T12:00:00-0700",
         "id": "137943263736990"
     }
     r = self.app.post(path='/me/events',
                       headers=getMockAuthHeaders(),
                       json=fb_dict
                       )
     result = r.json
     id_1 = result["id"]
     r = self.app.post(path='/me/events',
                       headers=getMockAuthHeaders(),
                       json=fb_dict
                       )
     result = r.json
     id_2 = result["id"]
     self.assertEqual(id_1, id_2)
    def testPutAndGet(self):

        to_put = {
            "luggages": [
                {
                    "luggage_type": "large",
                    "weight_in_lbs": 20
                },
                {
                    "luggage_type": "medium",
                    "weight_in_lbs": 15
                },
                {
                    "luggage_type": "medium",
                    "weight_in_lbs": 25
                }
            ]
        }

        print(json.dumps(to_put))

        # Note that the result may be hardcoded for now
        r = self.app.put(path='/rideRequests' + '/' + self.rideRequestId + '/' + "luggage",
                         json=to_put,
                         headers=getMockAuthHeaders()
                         )
        self.assertEqual(r.status_code, 200, "PUT luggage should be successful")

        r = self.app.get(path='/rideRequests' + '/' + self.rideRequestId + '/' + "luggage",
                         headers=getMockAuthHeaders()
                         )

        dict_expected = {
            "luggages": [
                {
                    "luggage_type": "large",
                    "weight_in_lbs": 20
                },
                {
                    "luggage_type": "medium",
                    "weight_in_lbs": 15
                },
                {
                    "luggage_type": "medium",
                    "weight_in_lbs": 25
                }
            ],
            "total_weight": 60,
            "total_count": 3
        }

        result = dict(r.json)

        self.assertEqual(r.status_code, 200, "GET luggage should be successful")
        self.assertDictEqual(dict_expected, result)
示例#6
0
    def testGet(self):
        """
        Note that test data generated by getEventDict has a 9AM-11AM range
        :return:
        """
        r = self.app.get(path='/events' + '/' + self.event_id,
                         headers=getMockAuthHeaders()
                         )

        dict_expected = {
            'eventCategory': "airport",
            'participants': [],
            'airportCode': "LAX",
            'earliestArrival': "2018-12-17T00:00:00",
            'earliestDeparture': '2018-12-17T00:00:00',
            'latestArrival': "2018-12-17T23:59:59",
            'latestDeparture': "2018-12-17T23:59:59",
            'pricing': 100,
            'locationId': "testairportlocationid1",
            'isClosed': False
        }

        result = dict(r.json)

        self.assertEqual(r.status_code, 200, "GET is successful")
        # print(result)
        self.assertDictContainsSubset(dict_expected, result)
示例#7
0
    def _tear_down(self):
        """
        Deletes all rideRequests created by the test
        :return:
        """
        for uid, rid in self.ride_request_ids_to_unmatch:
            r = self.app.post(path='/rideRequests/' + rid + '/' + 'unmatch',
                              headers=getMockAuthHeaders(uid=uid))
            assert r.status_code == 200

        for uid, rid in self.ride_request_ids_to_delete:
            r = self.app.delete(path='/rideRequests' + '/' + rid,
                                headers=getMockAuthHeaders(uid=uid))
            assert r.status_code == 200
        self.ride_request_ids_to_unmatch.clear()
        self.ride_request_ids_to_delete.clear()
    def testPutInvalid(self):
        to_put = {
            "luggages": [
                {
                    "luggage_type": "large",
                    "weight_in_lbs": "invalidInputInsteadOfNumber"
                },
                {
                    "luggage_type": "medium",
                    "weight_in_lbs": 15
                },
                {
                    "luggage_type": "medium",
                    "weight_in_lbs": 25
                }
            ]
        }

        print(json.dumps(to_put))

        # Note that the result may be hardcoded for now
        r = self.app.put(path='/rideRequests' + '/' + self.rideRequestId + '/' + "luggage",
                         json=to_put,
                         headers=getMockAuthHeaders()
                         )
        self.assertEqual(r.status_code, 422, "PUT luggage should fail with status 422")
示例#9
0
    def setUp(self):

        main.app.testing = True
        self.app = main.app.test_client()
        self.userIds = ["testuid1", "testuid2"]
        self.c = scripts.SetUpTestDatabase()
        self.c.clear_before()
        self.c.generate_test_data(start_string="2018-12-17T08:00:00.000",
                                  num_days=5)

        for userId in self.userIds:
            form = FormDictFactory().create(returnDict=True)
            form["flightLocalTime"] = "2018-12-20T12:00:00.000"
            form["testUserId"] = userId
            r = self.app.post(  # TODO: change everywhere to json=form (used to be json=json.dumps(form))
                path='/rideRequests',
                json=form,
                headers=getMockAuthHeaders(userId))
            print(r.json)
            # self.assertRaises(service_errors.RequestAlreadyExistsError)
            firestore_ref = r.json[
                "firestoreRef"]  # Not that it is actually rideRequestId
            self.ride_request_ids_to_unmatch.append((userId, firestore_ref))
            self.ride_request_ids_to_delete.append((userId, firestore_ref))

        uid, rid = self.ride_request_ids_to_delete[0]
        self.rideRequestId = rid

        r = self.app.post(path='/devForceMatch',
                          json=json.dumps({
                              "operationMode":
                              "two",
                              "rideRequestIds":
                              [i[1] for i in self.ride_request_ids_to_delete]
                          }))
示例#10
0
    def _tear_down(self):
        """
        Un-match all rideRequests created by the test
        Deletes all rideRequests created by the test
        :return:
        """
        for uid, rid in self.ride_request_ids_to_delete:
            r = self.app.post(path='/rideRequests/' + rid + '/' + 'unmatch',
                              headers=getMockAuthHeaders(uid=uid))
            if r.status_code != 200:
                warnings.warn("ride request rid: {} not unmatched".format(rid))

        for uid, rid in self.ride_request_ids_to_delete:
            r = self.app.delete(path='/rideRequests' + '/' + rid,
                                headers=getMockAuthHeaders(uid=uid))
            assert r.status_code == 200

        self.ride_request_ids_to_delete.clear()
示例#11
0
    def testCreateRideRequestsEarliestLatest(self):
        # Create new rideRequests
        for userId in self.userIds:
            form = FormDictFactory().create(returnDict=True, hasEarliestLatest=True, isE5L2=False)
            form["flightLocalTime"] = "2018-12-20T12:00:00.000"
            form["testUserId"] = userId
            r = self.app.post(  # TODO: change everywhere to json=form (used to be json=json.dumps(form))
                path='/rideRequests', json=form, headers=getMockAuthHeaders(userId))
            print(r)
            self.assertIn("firestoreRef", r.json.keys())
            firestore_ref = r.json["firestoreRef"]  # Not that it is actually rideRequestId
            self.ride_request_ids_to_delete.append((userId, firestore_ref))

            r = self.app.get(path='/rideRequests' + '/' + firestore_ref,
                             headers=getMockAuthHeaders()
                             )

            result = dict(r.json)
            self.assertEqual(result["target"]["arriveAtEventTime"]["earliest"], 1545066000)
示例#12
0
 def testCreateRideRequestsTemp(self):
     # Create new rideRequests
     for userId in self.userIds:
         form = FormDictFactory().create(returnDict=True)
         form["flightLocalTime"] = "2018-12-20T12:00:00.000"
         form["testUserId"] = userId
         r = self.app.post(  # TODO: change everywhere to json=form (used to be json=json.dumps(form))
             path='/rideRequests', json=form, headers=getMockAuthHeaders(userId))
         print(r)
         self.assertIn("firestoreRef", r.json.keys())
         firestore_ref = r.json["firestoreRef"]  # Not that it is actually rideRequestId
         self.ride_request_ids_to_delete.append((userId, firestore_ref))
示例#13
0
    def testGetEmpty(self):

        r = self.app.get(path='/rideRequests' + '/' + self.rideRequestId +
                         '/' + "luggage",
                         headers=getMockAuthHeaders())

        dict_expected = {}

        result = dict(r.json)

        self.assertEqual(r.status_code, 200, "GET is successful")
        self.assertDictEqual(dict_expected, result)
    def testGet(self):
        """
        Note that teardown will not delete the nested collection
        :return:
        """

        # doc_ref: DocumentReference = CTX.db.document(
        #     "rideRequests/{}/lcc/luggages_vm".format(self.rideRequestId)
        # )
        #
        #
        #
        # doc_ref.set(document_data={
        #             "luggages": [
        #             ],
        #             "total_weight": 0,
        #             "total_count": 0,
        #             "obj_type": "Luggages"
        #         })

        _ref: CollectionReference = CTX.db.collection("LuggageItem")
        _ref.add(
            {
                "luggage_type": "large",
                "weight_in_lbs": 20,
                "rideRequestId": self.rideRequestId,
                "obj_type": "LuggageItem"
            }
        )

        time.sleep(2)

        r = self.app.get(path='/rideRequests' + '/' + self.rideRequestId + '/' + "luggage",
                         headers=getMockAuthHeaders()
                         )

        dict_expected = {
                    "luggages": [
                        {
                            "luggage_type": "large",
                            "weight_in_lbs": 20,
                        }
                    ],
                    "total_weight": 20,
                    "total_count": 1
            }

        result = dict(r.json)

        self.assertEqual(r.status_code, 200, "GET is successful")
        self.assertDictEqual(dict_expected, result)
示例#15
0
def _create_ride_requests_for_tests(app, userIds, to_tear_down,
                                    rideRequestIds):

    for userId in userIds:

        form = FormDictFactory().create(returnDict=True)
        form["flightLocalTime"] = "2018-12-20T12:00:00.000"
        r = app.post(path='/rideRequests',
                     json=form,
                     headers=getMockAuthHeaders(uid=userId))
        print(r.data)
        assert r.status_code == 200
        rideRequestIds.append(r.json["firestoreRef"])
        to_tear_down.append((userId, r.json["firestoreRef"]))
示例#16
0
    def tearDown(self):
        """
        Deletes all rideRequests created by the test
        :return:
        """
        for uid, rid in self.ride_request_ids_to_delete:
            r = self.app.delete(path='/rideRequests' + '/' + rid,
                                headers=getMockAuthHeaders(uid=uid))
            assert r.status_code == 200
        self.ride_request_ids_to_delete.clear()

        for ref in self.refs_to_delete:
            ref.delete()
        self.refs_to_delete.clear()
示例#17
0
    def testPostDeprecatedEndpoint(self):
        userId = "testuid1a"
        r = self.app.post(  # TODO: change everywhere to json=form (used to be json=json.dumps(form))
            path='/requestRide/event',
            json={"rideCategory": "airport"},
            headers=getMockAuthHeaders(userId))

        error_return_expected = {
            "message":
            "Resource moved permanently. POST to /rideRequests instead. ",
            "status": 301
        }
        error_message_expected = error_return_expected["message"]
        error_status_code_expected = error_return_expected["status"]
        self.assertEqual(r.json["message"], error_message_expected)
        self.assertEqual(r.status_code, error_status_code_expected)
示例#18
0
    def test_delete_match_invalid(self):
        """ Delete match on a ride request that is not matched to an orbit should return 400

        :return:
        """
        for uid, rid in self.ride_request_ids_to_delete:
            r = self.app.post(path='/rideRequests/' + rid + '/' + 'unmatch',
                              headers=getMockAuthHeaders(uid=uid))
            error_return_expected = {
                "message":
                "Trying to un-match a ride request that is not matched to an orbit yet. ",
                "status": 400
            }
            error_message_expected = error_return_expected["message"]
            error_status_code_expected = error_return_expected["status"]
            self.assertEqual(r.status_code, error_status_code_expected)
            self.assertEqual(r.json["message"], error_message_expected)
示例#19
0
    def testCreateRideRequestsTemp(self):

        # Create new rideRequests
        for userId in self.userIds:
            form = self.d
            form["testUserId"] = userId
            r = self.app.post(  # TODO: change everywhere to json=form (used to be json=json.dumps(form))
                path='/rideRequests',
                json=form,
                headers=getMockAuthHeaders(userId))
            print(r.json)
            self.assertIn("firestoreRef", r.json.keys())
            rid = r.json["id"]
            ride_request = RideRequestGenericDao().get_by_id(rid)
            print(ride_request.to_dict())
            firestore_ref = ride_request.get_firestore_ref(
            )  # Not that it is actually rideRequestId

            self.ride_request_ids_to_delete.append((userId, firestore_ref.id))
示例#20
0
 def test_post(self):
     fb_dict = {
         "description": "Advance Sale begins Friday, 6/1 at 11AM PDT\nwww.coachella.com",
         "end_time": "2019-04-14T23:59:00-0700",
         "name": "Coachella Valley Music and Arts Festival 2019 - Weekend 1",
         "place": {
             "name": "Coachella",
             "location": {
                 "latitude": 33.679974,
                 "longitude": -116.237221
             },
             "id": "20281766647"
         },
         "start_time": "2019-04-12T12:00:00-0700",
         "id": "137943263736990"
     }
     r = self.app.post(path='/me/events',
                       headers=getMockAuthHeaders(),
                       json=fb_dict
                       )
     result = r.json
     print(result)
    def testGetTrivial(self):
        """
        Note that teardown will not delete the nested collection
        :return:
        """

        doc_ref: DocumentReference = CTX.db.document(
            "rideRequests/{}/lcc/luggages_vm".format(self.rideRequestId)
        )

        doc_ref.set(document_data={
                    "luggages": [
                    ],
                    "total_weight": 0,
                    "total_count": 0,
                    "obj_type": "Luggages"
                })

        time.sleep(2)

        r = self.app.get(
            path='/rideRequests' + '/' + self.rideRequestId + '/' + "luggage",
            headers=getMockAuthHeaders()
            )

        dict_expected = {
            "luggages": [
            ],
            "total_weight": 0,
            "total_count": 0
        }

        result = dict(r.json)

        self.assertEqual(r.status_code, 200, "GET is successful")
        self.assertDictEqual(dict_expected, result)
示例#22
0
    def testGet(self):
        r = self.app.get(path='/rideRequests' + '/' + self.rideRequestId,
                            headers=getMockAuthHeaders()
                            )

        ride_request_dict = {

            'rideCategory': 'airportRide',
            'pickupAddress': "Tenaya Hall, San Diego, CA 92161",
            'driverStatus': False,

            'target': {'eventCategory': 'airportRide',
                       'toEvent': True,
                       'arriveAtEventTime':
                           {'earliest': 1545318000, 'latest': 1545328800}},

            'userId': "testuid1",
            'hasCheckedIn': False,
            'pricing': 987654321,
            "baggages": dict(),
            "disabilities": dict(),
            'flightLocalTime': "2018-12-20T12:00:00.000",
            'flightNumber': "DL89",
            "requestCompletion": False,

        }


        result = dict(r.json)
        print(json.dumps(result))

        self.assertIsNotNone(result["locationId"])
        self.assertIsNotNone(result["eventId"])
        self.assertIsNone(result["orbitId"])
        self.assertEqual(r.status_code, 200)
        self.assertDictContainsSubset(ride_request_dict, result)
示例#23
0
 def testDelete(self):
     r = self.app.delete(path='/rideRequests' + '/' + self.rideRequestId,
                         headers=getMockAuthHeaders()
                         )
     print(r.data)
     self.assertEqual(r.status_code, 200)
示例#24
0
 def test_delete_match(self):
     for uid, rid in self.ride_request_ids_to_delete:
         r = self.app.post(path='/rideRequests/' + rid + '/' + 'unmatch',
                           headers=getMockAuthHeaders(uid=uid))
         self.assertEqual(r.status_code, 200)
示例#25
0
 def test_put_many(self):
     fb_dicts = { "data": [
         {
             "description": "Pool season will be back in session from June 7-9 for Splash House 2019 💦\n\nPackages and early bird pre-sale begins Wed, 2/6 at 12PM PT at www.splashhouse.com \n21+\n\nJune 7 / 8 / 9\nPalm Springs, CA\nBringing the best house music to 3 resorts:\nRenaissance Palm Springs Hotel\nThe Riviera Palm Springs, A Tribute Portfolio Resort\nThe Saguaro Palm Springs\n+\nAfter Hours at Palm Springs Air Museum",
             "end_time": "2019-06-09T23:00:00-0700",
             "name": "Splash House June 2019",
             "place": {
                 "name": "Palm Springs",
                 "location": {
                     "city": "Palm Springs",
                     "country": "United States",
                     "latitude": 33.8443,
                     "longitude": -116.5279,
                     "state": "CA",
                     "zip": "92262–92264"
                 },
                 "id": "108231342537990"
             },
             "start_time": "2019-06-07T12:00:00-0700",
             "id": "531366380703501",
             "rsvp_status": "unsure"
         },
         {
             "description": "Goldenvoice presents\nThe Cure to Loneliness Tour\n\nJAI WOLF\nwith shallou\n\nSAT, 1 JUN 2019 at 09:00PM PDT\nAges: 18 & Over\nDoors Open: 08:00PM\n\nOnSale: Fri, 18 Jan 2019 at 10:00AM PST\nAnnouncement: Mon, 14 Jan 2019 at 10:00AM PST\n\n2nd show added for Fri, 5/31. Tickets available HERE",
             "name": "Jai Wolf",
             "place": {
                 "name": "Shrine Auditorium & Expo Hall",
                 "location": {
                     "city": "Los Angeles",
                     "country": "United States",
                     "latitude": 34.023527532076,
                     "longitude": -118.28130708212,
                     "state": "CA",
                     "street": "665 W Jefferson Blvd",
                     "zip": "90007"
                 },
                 "id": "81721568089"
             },
             "start_time": "2019-06-01T21:00:00-0700",
             "id": "284909175532434",
             "rsvp_status": "unsure"
         },
         {
             "description": "91X, Z90 & Magic 92.5 presents 2019 SoCal TACO FEST!   \n\nThe event will take place on Saturday, May 18th at Waterfront Park in downtown San Diego, with over 25 of your favorite restaurants for San Diego’s BIGGEST taco festival! Plus, live Lucha Libre wrestling, Chihuahua races & beauty pageant, and a bumpin’ Margarita Tent!\n\nWith a music lineup featuring:\nNelly\nSuper Diamond\nArise Roots\nDJ D-ROCK\nand more TBA!\n\nTICKETS ARE ON SALE NOW:\nhttps://tickets.socaltacofest.com/e/socal-taco-fest/tickets\n\n2019 SoCal TACO FEST is 21+ and up only.\n\n@SoCalTacoFest on Twitter & Instagram!",
             "end_time": "2019-05-18T22:00:00-0700",
             "name": "SoCal TACO FEST 2019",
             "place": {
                 "name": "Waterfront Park",
                 "location": {
                     "city": "San Diego",
                     "country": "United States",
                     "latitude": 32.72199,
                     "longitude": -117.17205,
                     "state": "CA",
                     "street": "1600 Pacific Hwy",
                     "zip": "92101"
                 },
                 "id": "1714199095465525"
             },
             "start_time": "2019-05-18T11:00:00-0700",
             "id": "312156202757788",
             "rsvp_status": "unsure"
         },
         {
             "description": "49th Celebration Day",
             "name": "Santana pa Ti Live / Chicano Park",
             "place": {
                 "name": "Chicano Park",
                 "location": {
                     "city": "San Diego",
                     "country": "United States",
                     "latitude": 32.700194037186,
                     "longitude": -117.14327617597,
                     "state": "CA",
                     "street": "National Ave",
                     "zip": "92113"
                 },
                 "id": "119225144790924"
             },
             "start_time": "2019-04-20T12:00:00-0700",
             "id": "441105913093298",
             "rsvp_status": "attending"
         },
         {
             "description": "The 49th annual Chicano Park Day celebration will be held on Saturday, April 20, 2019. The annual celebration is held in historic Chicano Park, located in the Logan Heights community, south of downtown San Diego under the San Diego-Coronado bridge. \n\nThe theme for the 2019 celebration is 'Danzantes, Protectors of Our Traditions and Chicano Park, 500 Years of Anti-Colonial Struggle.'\n\nThis family event is always free and open to the public.\n\nThe celebration will include Aztec Indigenous dance, coordinated by coordinated by Danza Azteca Calpulli Mexihca, live bands on two stages, ballet folklórico and other danza groups and speakers. In addition, there were kids arts workshops, a display of classic lowrider cars coordinated by Amigos Car Club, speakers, and various food, arts & crafts, and informational booths.\n\n*NO ALCOHOL and NO PETS, other than service animals are allowed at the event. Thank you for your cooperation.*\n\nPublic transportation: Take the blue line trolley to the Barrio Logan station or the orange line to 25th and Commercial. For alternate routes, go to www.sdmts.com/Tripplanner.asp",
             "end_time": "2019-04-20T17:00:00-0700",
             "name": "49th Chicano Park Day Celebration",
             "place": {
                 "name": "Chicano Park",
                 "location": {
                     "city": "San Diego",
                     "country": "United States",
                     "latitude": 32.700194037186,
                     "longitude": -117.14327617597,
                     "state": "CA",
                     "street": "National Ave",
                     "zip": "92113"
                 },
                 "id": "119225144790924"
             },
             "start_time": "2019-04-20T10:00:00-0700",
             "id": "291514501708008",
             "rsvp_status": "unsure"
         },
         {
             "description": "Advance Sale begins Friday, 6/1 at 11AM PDT\nwww.coachella.com",
             "end_time": "2019-04-14T23:59:00-0700",
             "name": "Coachella Valley Music and Arts Festival 2019 - Weekend 1",
             "place": {
                 "name": "Coachella",
                 "location": {
                     "latitude": 33.679974,
                     "longitude": -116.237221
                 },
                 "id": "20281766647"
             },
             "start_time": "2019-04-12T12:00:00-0700",
             "id": "137943263736990",
             "rsvp_status": "unsure"
         },
         {
             "description": "El Gordo Viclas present Ay Guey Custom Viclas",
             "name": "Day at the Bay Viclas and Car Show",
             "place": {
                 "name": "Embarcadero Marina Park South",
                 "location": {
                     "city": "San Diego",
                     "country": "United States",
                     "latitude": 32.704328082064,
                     "located_in": "358290337510",
                     "longitude": -117.16464887991,
                     "state": "CA",
                     "street": "111 W Harbor Dr",
                     "zip": "92101"
                 },
                 "id": "2042612439087865"
             },
             "start_time": "2019-04-07T23:10:00-0700",
             "id": "629428087472698",
             "rsvp_status": "unsure"
         }
     ] }
     r = self.app.put(path='/me/events',
                      headers=getMockAuthHeaders(),
                      json=fb_dicts
                      )
     result = r.json
     self.assertDictEqual(result,
                          {
                              "ids": [
                                  "531366380703501",
                                  "284909175532434",
                                  "312156202757788",
                                  "441105913093298",
                                  "291514501708008",
                                  "137943263736990",
                                  "629428087472698"
                              ]
                          })