Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 3
0
def index_plant():
    plants = Plant.query.all()
    data = Plant.jsonify(plants, many=True)
    return utils.json_response(data)
Ejemplo n.º 4
0
def index_plant():
    plants = Plant.query.all()
    data = Plant.jsonify(plants, many=True)
    return utils.json_response(data)