Exemple #1
0
def test_serializer(session, location):
    session.add(location)
    session.commit()
    location_json = location.jsonify()
    # class and instance json are the same
    assert Location.jsonify(location) == location_json
    assert 'str' in location_json
Exemple #2
0
def test_serializer(session, location):
    session.add(location)
    session.commit()
    location_json = location.jsonify()
    # class and instance json are the same
    assert Location.jsonify(location) == location_json
    assert 'str' in location_json
Exemple #3
0
def index_location():
    locations = Location.query.all()
    data = Location.jsonify(locations, many=True)
    return utils.json_response(data)
Exemple #4
0
def index_location():
    locations = Location.query.all()
    data = Location.jsonify(locations, many=True)
    return utils.json_response(data)
Exemple #5
0
def location():
    from bauble.models import Location
    return Location(code=faker.pystr(10))