Skip to content

Commit 9da1715

Browse files
committed
fixing key-prefix issue
1 parent 3ef6cca commit 9da1715

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

tests/test_hash_model.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -928,9 +928,11 @@ class TestLiterals(HashModel):
928928

929929
schema = TestLiterals.redisearch_schema()
930930

931+
key_prefix = TestLiterals.make_key(
932+
TestLiterals._meta.primary_key_pattern.format(pk="")
933+
)
931934
assert schema == (
932-
"ON HASH PREFIX 1 :tests.test_hash_model.TestLiterals: SCHEMA pk TAG SEPARATOR | flavor TAG "
933-
"SEPARATOR |"
935+
f"ON HASH PREFIX 1 {key_prefix} SCHEMA pk TAG SEPARATOR | flavor TAG SEPARATOR |"
934936
)
935937
await Migrator().run()
936938
item = TestLiterals(flavor="pumpkin")

tests/test_json_model.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1133,8 +1133,11 @@ class TestLiterals(JsonModel):
11331133

11341134
schema = TestLiterals.redisearch_schema()
11351135

1136+
key_prefix = TestLiterals.make_key(
1137+
TestLiterals._meta.primary_key_pattern.format(pk="")
1138+
)
11361139
assert schema == (
1137-
"ON JSON PREFIX 1 :tests.test_json_model.TestLiterals: SCHEMA $.pk AS pk TAG SEPARATOR | "
1140+
f"ON JSON PREFIX 1 {key_prefix} SCHEMA $.pk AS pk TAG SEPARATOR | "
11381141
"$.flavor AS flavor TAG SEPARATOR |"
11391142
)
11401143
await Migrator().run()

0 commit comments

Comments
 (0)