Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: use String/Text over Unicode/UnicodeText #151

Merged
merged 1 commit into from
Feb 19, 2024
Merged
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
8 changes: 4 additions & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
DateTime,
ForeignKey,
Integer,
String,
Text,
text,
Unicode,
UnicodeText,
)
from sqlalchemy.orm import (
close_all_sessions,
Expand Down Expand Up @@ -176,12 +176,12 @@ class TextItem(Base):

id = Column(Integer, primary_key=True, autoincrement=True)

name = Column(Unicode(255))
name = Column(String(255))

search_vector = Column(TSVectorType("name", "content", **ts_vector_options))
content_search_vector = Column(TSVectorType("content", **ts_vector_options))

content = Column(UnicodeText)
content = Column(Text)

return TextItem

Expand Down
8 changes: 4 additions & 4 deletions tests/test_multiple_vectors_per_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ class TextItem(Base):

id = sa.Column(sa.Integer, primary_key=True, autoincrement=True)

name = sa.Column(sa.Unicode(255))
name = sa.Column(sa.String(255))

content = sa.Column(sa.UnicodeText)
content = sa.Column(sa.Text)

name_vector = sa.Column(TSVectorType("name", auto_index=True))

Expand All @@ -45,8 +45,8 @@ class TextMultiItem(Base):

id = sa.Column(sa.Integer, primary_key=True, autoincrement=True)

name = sa.Column(sa.Unicode(255))
content = sa.Column(sa.UnicodeText)
name = sa.Column(sa.String(255))
content = sa.Column(sa.Text)
name_vector = sa.Column(TSVectorType("name", auto_index=False))
content_vector = sa.Column(TSVectorType("content", auto_index=False))

Expand Down
4 changes: 2 additions & 2 deletions tests/test_schema_creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ class TextItem(Base):

id = sa.Column(sa.Integer, primary_key=True, autoincrement=True)

name = sa.Column(sa.Unicode(255))
name = sa.Column(sa.String(255))

search_vector = sa.Column(TSVectorType(auto_index=True))

content = sa.Column(sa.UnicodeText)
content = sa.Column(sa.Text)
4 changes: 2 additions & 2 deletions tests/test_single_table_inheritance.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ class TextItem(Base):

id = sa.Column(sa.Integer, primary_key=True, autoincrement=True)

name = sa.Column(sa.Unicode(255))
name = sa.Column(sa.String(255))

search_vector = sa.Column(TSVectorType("name", "content"))

content = sa.Column(sa.UnicodeText)
content = sa.Column(sa.Text)

class Article(TextItem):
created_at = sa.Column(sa.DateTime)
2 changes: 1 addition & 1 deletion tests/test_vectorizers.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Article(Base):
TSVectorType("name", "content", regconfig="simple")
)

content = sa.Column(sa.UnicodeText)
content = sa.Column(sa.Text)

@vectorizer(HSTORE)
def hstore_vectorizer(column):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_weighted_search_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class WeightedTextItem(Base):

id = sa.Column(sa.Integer, primary_key=True, autoincrement=True)

name = sa.Column(sa.Unicode(255))
content = sa.Column(sa.UnicodeText)
name = sa.Column(sa.String(255))
content = sa.Column(sa.Text)
search_vector = sa.Column(
TSVectorType("name", "content", weights={"name": "A", "content": "B"})
)
Expand Down
Loading