# Path: APITaxi_models2/unittest/factories.py
# class UserFactory(BaseFactory):
#     class Meta:
#         model = User
#         sqlalchemy_get_or_create = ('email',)
# 
#     email = factory.Sequence(lambda n: 'test_user_%d' % n)
#     password = 'super_password'
#     active = True
#     confirmed_at = datetime.datetime(2015, 12, 1, 13, 37)
#     apikey = factory.Sequence(lambda n: 'API_KEY_%d' % n)


from APITaxi_models2.unittest.factories import UserFactory

        # Null values accepted for strings but not stored as is
        resp = operateur.client.put('/users/%s' % operateur.user.id, json={'data': [{
            'name': None,
            'email_customer': None,
            'email_technical': None,
            'operator_api_key': None,
            'operator_header_name': None,
            'phone_number_customer': None,
            'phone_number_technical': None,
            'hail_endpoint_production': None,
        }]})
        assert resp.status_code == 200
        assert operateur.user.commercial_name == ''
        assert operateur.user.email_customer == ''
        assert operateur.user.email_technical == ''
        assert operateur.user.operator_api_key == ''
        assert operateur.user.operator_header_name == ''
        assert operateur.user.phone_number_customer == ''
        assert operateur.user.phone_number_technical == ''
        assert operateur.user.hail_endpoint_production == ''

        # Other fields can be updated.
        resp = operateur.client.put('/users/%s' % operateur.user.id, json={'data': [{
            'name': 'New commercial name',
            'email_customer': 'new email customer',
            'email_technical': 'new email technical',
            'hail_endpoint_production': 'new hail endpoint production',
            'phone_number_customer': 'new phone number customer',
            'phone_number_technical': 'new phone number technical',

# Path: APITaxi_models2/unittest/factories.py
# class UserFactory(BaseFactory):
#     class Meta:
#         model = User
#         sqlalchemy_get_or_create = ('email',)
# 
#     email = factory.Sequence(lambda n: 'test_user_%d' % n)
#     password = 'super_password'
#     active = True
#     confirmed_at = datetime.datetime(2015, 12, 1, 13, 37)
#     apikey = factory.Sequence(lambda n: 'API_KEY_%d' % n)


# Path: APITaxi2/tests/test_users.py
from APITaxi_models2.unittest.factories import UserFactory


        # Null values accepted for strings but not stored as is
        resp = operateur.client.put('/users/%s' % operateur.user.id, json={'data': [{
            'name': None,
            'email_customer': None,
            'email_technical': None,
            'operator_api_key': None,
            'operator_header_name': None,
            'phone_number_customer': None,
            'phone_number_technical': None,
            'hail_endpoint_production': None,
        }]})
        assert resp.status_code == 200
        assert operateur.user.commercial_name == ''
        assert operateur.user.email_customer == ''
        assert operateur.user.email_technical == ''
        assert operateur.user.operator_api_key == ''
        assert operateur.user.operator_header_name == ''
        assert operateur.user.phone_number_customer == ''
        assert operateur.user.phone_number_technical == ''
        assert operateur.user.hail_endpoint_production == ''

        # Other fields can be updated.
        resp = operateur.client.put('/users/%s' % operateur.user.id, json={'data': [{
            'name': 'New commercial name',
            'email_customer': 'new email customer',
            'email_technical': 'new email technical',
            'hail_endpoint_production': 'new hail endpoint production',
            'phone_number_customer': 'new phone number customer',
            'phone_number_technical': 'new phone number technical',

            'operator_api_key': 'new operator api key',