mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
SQLite model refactoring (#3791)
* Remove ID from PerformerPartial * Separate studio model from sqlite model * Separate movie model from sqlite model * Separate tag model from sqlite model * Separate saved filter model from sqlite model * Separate scene marker model from sqlite model * Separate gallery chapter model from sqlite model * Move ErrNoRows checks into sqlite, improve empty result error messages * Move SQLiteDate and SQLiteTimestamp to sqlite * Use changesetTranslator everywhere, refactor for consistency * Make PerformerStore.DestroyImage private * Fix rating on movie create
This commit is contained in:
@@ -1168,44 +1168,6 @@ func TestPerformerUpdatePerformerImage(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestPerformerDestroyPerformerImage(t *testing.T) {
|
||||
if err := withRollbackTxn(func(ctx context.Context) error {
|
||||
qb := db.Performer
|
||||
|
||||
// create performer to test against
|
||||
const name = "TestPerformerDestroyPerformerImage"
|
||||
performer := models.Performer{
|
||||
Name: name,
|
||||
}
|
||||
err := qb.Create(ctx, &performer)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Error creating performer: %s", err.Error())
|
||||
}
|
||||
|
||||
image := []byte("image")
|
||||
err = qb.UpdateImage(ctx, performer.ID, image)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Error updating performer image: %s", err.Error())
|
||||
}
|
||||
|
||||
err = qb.DestroyImage(ctx, performer.ID)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Error destroying performer image: %s", err.Error())
|
||||
}
|
||||
|
||||
// image should be nil
|
||||
storedImage, err := qb.GetImage(ctx, performer.ID)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Error getting image: %s", err.Error())
|
||||
}
|
||||
assert.Nil(t, storedImage)
|
||||
|
||||
return nil
|
||||
}); err != nil {
|
||||
t.Error(err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
func TestPerformerQueryAge(t *testing.T) {
|
||||
const age = 19
|
||||
ageCriterion := models.IntCriterionInput{
|
||||
|
||||
Reference in New Issue
Block a user