From c0a37ca36a57e5c54869c1d29484e37620daef5f Mon Sep 17 00:00:00 2001 From: Theresa Gresch Date: Fri, 1 May 2020 13:11:24 +0200 Subject: [PATCH] Backend: Add fixtures photoalbum --- internal/entity/photo_album_fixtures.go | 31 +++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 internal/entity/photo_album_fixtures.go diff --git a/internal/entity/photo_album_fixtures.go b/internal/entity/photo_album_fixtures.go new file mode 100644 index 000000000..760fc64d6 --- /dev/null +++ b/internal/entity/photo_album_fixtures.go @@ -0,0 +1,31 @@ +package entity + +import "time" + +var PhotoAlbumFixtures = map[string]PhotoAlbum{ + "1": { + PhotoUUID: "1jxf3jfn2k", + AlbumUUID: "pq9jtdre2lvl0yh7", + Order: 0, + CreatedAt: time.Date(2020, 3, 6, 2, 6, 51, 0, time.UTC), + UpdatedAt: time.Date(2020, 3, 28, 14, 6, 0, 0, time.UTC), + Photo: &PhotoFixture19800101_000002_D640C559, + Album: &AlbumFixtureHoliday2030, + }, + "2": { + PhotoUUID: "pq9jtdre2lvl0y11", + AlbumUUID: "aq9lxuqxpogaaba9", + Order: 0, + CreatedAt: time.Date(2020, 2, 6, 2, 6, 51, 0, time.UTC), + UpdatedAt: time.Date(2020, 4, 28, 14, 6, 0, 0, time.UTC), + Photo: &PhotoFixturePhoto04, + Album: &AlbumFixtureBerlin2019, + }, +} + +// CreatePhotoAlbumFixtures inserts known entities into the database for testing. +func CreatePhotoAlbumFixtures() { + for _, entity := range PhotoAlbumFixtures { + Db().Create(&entity) + } +}