Backend: Add fixtures for photolabels
This commit is contained in:
parent
c0a37ca36a
commit
5d2c4fa5d6
1 changed files with 27 additions and 0 deletions
27
internal/entity/photo_label_fixtures.go
Normal file
27
internal/entity/photo_label_fixtures.go
Normal file
|
@ -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)
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue