Example #1
0
def test_serializer(session, plant):
    session.add(plant)
    session.commit()
    plant_json = plant.jsonify()
    # class and instance json are the same
    assert Plant.jsonify(plant) == plant_json
    assert 'str' in plant_json
    assert plant_json['accession']['id'] == plant.accession_id
Example #2
0
def test_serializer(session, plant):
    session.add(plant)
    session.commit()
    plant_json = plant.jsonify()
    # class and instance json are the same
    assert Plant.jsonify(plant) == plant_json
    assert 'str' in plant_json
    assert plant_json['accession']['id'] == plant.accession_id
Example #3
0
def index_plant():
    plants = Plant.query.all()
    data = Plant.jsonify(plants, many=True)
    return utils.json_response(data)
Example #4
0
def index_plant():
    plants = Plant.query.all()
    data = Plant.jsonify(plants, many=True)
    return utils.json_response(data)