Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ redis = ">=3.5.3,<7.0.0"
pydantic = ">=2.0.0,<3.0.0"
click = "^8.0.1"
types-redis = ">=3.5.9,<5.0.0"
python-ulid = "^1.0.3"
python-ulid = ">=1.0.3, <=3.1.0"
typing-extensions = "^4.4.0"
hiredis = ">=2.2.3,<4.0.0"
more-itertools = ">=8.14,<11.0"
Expand Down
12 changes: 9 additions & 3 deletions tests/test_json_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1528,7 +1528,9 @@ class Product(JsonModel, index=True):
name: str = Field(index=True, sortable=True) # TAG field with sortable
category: str = Field(index=True, sortable=True) # TAG field with sortable
price: int = Field(index=True, sortable=True) # NUMERIC field with sortable
tags: List[str] = Field(index=True, sortable=True) # TAG field (list) with sortable
tags: List[str] = Field(
index=True, sortable=True
) # TAG field (list) with sortable

class Meta:
global_key_prefix = key_prefix
Expand All @@ -1543,9 +1545,13 @@ class Meta:
await Migrator().run()

# Create test data
product1 = Product(name="Zebra", category="Animals", price=100, tags=["wild", "africa"])
product1 = Product(
name="Zebra", category="Animals", price=100, tags=["wild", "africa"]
)
product2 = Product(name="Apple", category="Fruits", price=50, tags=["red", "sweet"])
product3 = Product(name="Banana", category="Fruits", price=30, tags=["yellow", "sweet"])
product3 = Product(
name="Banana", category="Fruits", price=30, tags=["yellow", "sweet"]
)

await product1.save()
await product2.save()
Expand Down