Backend: Add test fixtures for countries
This commit is contained in:
parent
785d433ba9
commit
6188c7f736
25
internal/entity/country_fixtures.go
Normal file
25
internal/entity/country_fixtures.go
Normal file
|
@ -0,0 +1,25 @@
|
|||
package entity
|
||||
|
||||
import (
|
||||
"github.com/jinzhu/gorm"
|
||||
)
|
||||
|
||||
var CountryFixtures = map[string]Country{
|
||||
"apple-iphone-se": {
|
||||
ID: "de",
|
||||
CountrySlug: "germany",
|
||||
CountryName: "Germany",
|
||||
CountryDescription: "Country description",
|
||||
CountryNotes: "Country Notes",
|
||||
CountryPhoto: nil,
|
||||
CountryPhotoID: 0,
|
||||
New: false,
|
||||
},
|
||||
}
|
||||
|
||||
// CreateCountryFixtures inserts known entities into the database for testing.
|
||||
func CreateCountryFixtures(db *gorm.DB) {
|
||||
for _, entity := range CountryFixtures {
|
||||
db.Create(&entity)
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue