Made tests work again
continuous-integration/drone/pr Build is failing Details

This commit is contained in:
kolaente 2019-10-10 20:10:00 +02:00
parent 6a78421066
commit 48ae52286d
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
4 changed files with 15 additions and 1 deletions

View File

@ -56,6 +56,11 @@ func (f *File) LoadFileByID() (err error) {
return
}
func (f *File) LoadFileMetaByID() (err error) {
_, err = x.Where("id = ?", f.ID).Get(f)
return
}
// Create creates a new file from an FileHeader
func Create(f *multipart.FileHeader, a web.Auth) (file *File, err error) {

View File

@ -1,2 +1,5 @@
- id: 1
name: test
size: 100
inserted_unix: 0
created_by_id: 1

View File

@ -81,7 +81,8 @@ func (ta *TaskAttachment) ReadOne() (err error) {
}
// Get the file
ta.File.ID = ta.FileID
ta.File = &files.File{ID: ta.FileID}
err = ta.File.LoadFileMetaByID()
return
}

View File

@ -94,6 +94,11 @@ func createTestEngine(fixturesDir string) error {
}
}
err = files.SetEngine()
if err != nil {
log.Fatal(err.Error())
}
return InitFixtures(fixturesHelper, fixturesDir)
}