From 5d2c4fa5d67f99e4e8a3504ececf146deb4ae0bf Mon Sep 17 00:00:00 2001 From: Theresa Gresch Date: Fri, 1 May 2020 13:11:42 +0200 Subject: [PATCH] Backend: Add fixtures for photolabels --- internal/entity/photo_label_fixtures.go | 27 +++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 internal/entity/photo_label_fixtures.go diff --git a/internal/entity/photo_label_fixtures.go b/internal/entity/photo_label_fixtures.go new file mode 100644 index 000000000..b269ec6e4 --- /dev/null +++ b/internal/entity/photo_label_fixtures.go @@ -0,0 +1,27 @@ +package entity + +var PhotoLabelFixtures = map[string]PhotoLabel{ + "1": { + PhotoID: 1000000, + LabelID: 1000001, + LabelSrc: "image", + Uncertainty: 38, + Photo: &PhotoFixture19800101_000002_D640C559, + Label: &LabelFixtureFlower, + }, + "2": { + PhotoID: 1000000, + LabelID: 1000002, + LabelSrc: "image", + Uncertainty: 38, + Photo: &PhotoFixture19800101_000002_D640C559, + Label: &LabelFixtureCake, + }, +} + +// CreatePhotoLabelFixtures inserts known entities into the database for testing. +func CreatePhotoLabelFixtures() { + for _, entity := range PhotoLabelFixtures { + Db().Create(&entity) + } +}