@@ -0,0 +1,18 @@
|
||||
package userwatchrecordmod
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"go.mongodb.org/mongo-driver/bson"
|
||||
)
|
||||
|
||||
func TestListRequestFilterExcludesDramaHistory(t *testing.T) {
|
||||
filter := (&ListRequest{}).Filter(42)
|
||||
if filter["uid"] != uint64(42) {
|
||||
t.Fatalf("uid filter = %v, want 42", filter["uid"])
|
||||
}
|
||||
typeFilter, ok := filter["type"].(bson.M)
|
||||
if !ok || typeFilter["$ne"] != "drama" {
|
||||
t.Fatalf("type filter = %#v, want drama exclusion", filter["type"])
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user