# Path: APITaxi_models2/unittest/factories.py
# class BaseFactory(factory.alchemy.SQLAlchemyModelFactory):
#     class Meta:
# class RoleFactory(BaseFactory):
#     class Meta:
# class UserFactory(BaseFactory):
#     class Meta:
# class RolesUsersFactory(BaseFactory):
#     class Meta:
# class CustomerFactory(BaseFactory):
#     class Meta:
# class DepartementFactory(BaseFactory):
#     class Meta:
# class TownFactory(BaseFactory):
#     class Meta:
#     class Params:
# class ZUPCFactory(BaseFactory):
#     class Meta:
#     class Params:
# class DriverFactory(BaseFactory):
#     class Meta:
# class VehicleDescriptionFactory(BaseFactory):
#     class Meta:
# class VehicleFactory(BaseFactory):
#     class Meta:
# class ADSFactory(BaseFactory):
#     class Meta:
# class TaxiFactory(BaseFactory):
#     class Meta:
# class HailFactory(BaseFactory):
#     class Meta:
#     def descriptions(self, create, extracted, **kwargs):
# 
# Path: APITaxi2/redis_backend.py
# class _Taxi:
# class _TaxiLocationUpdate:
# class Location:
# def get_taxi(taxi_id, operator_name):
# def get_timestamps_entries_between(start_timestamp, end_timestamp):
# def list_taxis(start_timestamp, end_timestamp):
# def set_taxi_availability(taxi_id, taxi_operator, available):
# def taxis_locations_by_operator(lon, lat, distance):
# def log_hail(hail_id, http_method, request_payload, hail_initial_status,
#              request_user=None, response_payload=None,
#              response_status_code=None, hail_final_status=None):
#     PREFIX = len(b'taxi:')


from APITaxi_models2.unittest import factories
from APITaxi2 import redis_backend
        assert 'lat' in response.json['errors']['data']['0']['positions']['0']

        # Not updated
        redis_taxi = redis_backend.get_taxi(taxi.id, operateur.user.email)
        assert redis_taxi is None

    def test_outside_france(self, operateur):
        taxi = factories.TaxiFactory(added_by=operateur.user)
        response = operateur.client.post('/geotaxi', json={
            'data': [{
                'positions': [{'taxi_id': taxi.id, 'lon': 48.86, 'lat': 2.35}]  # Inverted
            }]
        })
        assert response.status_code == 200  # Accepted for now

        # Accepted for now
        redis_taxi = redis_backend.get_taxi(taxi.id, operateur.user.email)
        assert redis_taxi is not None

    def test_one_valid_one_invalid(self, operateur):
        taxi = factories.TaxiFactory(added_by=operateur.user)
        response = operateur.client.post('/geotaxi', json={
            'data': [{
                'positions': [
                    {'taxi_id': taxi.id, 'lon': 2.35, 'lat': 48.86},
                    {'taxi_id': 'dummy', 'lon': 2.35, 'lat': 48.86},
                ]
            }]
        })
        assert response.status_code == 400

# Path: APITaxi_models2/unittest/factories.py
# class BaseFactory(factory.alchemy.SQLAlchemyModelFactory):
#     class Meta:
# class RoleFactory(BaseFactory):
#     class Meta:
# class UserFactory(BaseFactory):
#     class Meta:
# class RolesUsersFactory(BaseFactory):
#     class Meta:
# class CustomerFactory(BaseFactory):
#     class Meta:
# class DepartementFactory(BaseFactory):
#     class Meta:
# class TownFactory(BaseFactory):
#     class Meta:
#     class Params:
# class ZUPCFactory(BaseFactory):
#     class Meta:
#     class Params:
# class DriverFactory(BaseFactory):
#     class Meta:
# class VehicleDescriptionFactory(BaseFactory):
#     class Meta:
# class VehicleFactory(BaseFactory):
#     class Meta:
# class ADSFactory(BaseFactory):
#     class Meta:
# class TaxiFactory(BaseFactory):
#     class Meta:
# class HailFactory(BaseFactory):
#     class Meta:
#     def descriptions(self, create, extracted, **kwargs):
# 
# Path: APITaxi2/redis_backend.py
# class _Taxi:
# class _TaxiLocationUpdate:
# class Location:
# def get_taxi(taxi_id, operator_name):
# def get_timestamps_entries_between(start_timestamp, end_timestamp):
# def list_taxis(start_timestamp, end_timestamp):
# def set_taxi_availability(taxi_id, taxi_operator, available):
# def taxis_locations_by_operator(lon, lat, distance):
# def log_hail(hail_id, http_method, request_payload, hail_initial_status,
#              request_user=None, response_payload=None,
#              response_status_code=None, hail_final_status=None):
#     PREFIX = len(b'taxi:')


# Path: APITaxi2/tests/test_geotaxi.py
from APITaxi_models2.unittest import factories
from APITaxi2 import redis_backend

        assert 'lat' in response.json['errors']['data']['0']['positions']['0']

        # Not updated
        redis_taxi = redis_backend.get_taxi(taxi.id, operateur.user.email)
        assert redis_taxi is None

    def test_outside_france(self, operateur):
        taxi = factories.TaxiFactory(added_by=operateur.user)
        response = operateur.client.post('/geotaxi', json={
            'data': [{
                'positions': [{'taxi_id': taxi.id, 'lon': 48.86, 'lat': 2.35}]  # Inverted
            }]
        })
        assert response.status_code == 200  # Accepted for now

        # Accepted for now
        redis_taxi = redis_backend.get_taxi(taxi.id, operateur.user.email)
        assert redis_taxi is not None

    def test_one_valid_one_invalid(self, operateur):
        taxi = factories.TaxiFactory(added_by=operateur.user)
        response = operateur.client.post('/geotaxi', json={
            'data': [{
                'positions': [
                    {'taxi_id': taxi.id, 'lon': 2.35, 'lat': 48.86},
                    {'taxi_id': 'dummy', 'lon': 2.35, 'lat': 48.86},
                ]
            }]
        })
        assert response.status_code == 400

        assert 'taxi_id' in response.json['errors']['data']['0']['positions']['1']