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
def index_location(): locations = Location.query.all() data = Location.jsonify(locations, many=True) return utils.json_response(data)
def location(): from bauble.models import Location return Location(code=faker.pystr(10))