Skip to content

Commit

Permalink
test: use String/Text over Unicode/UnicodeText
Browse files Browse the repository at this point in the history
  • Loading branch information
jpvanhal committed Feb 19, 2024
1 parent 448c848 commit ee76d3d
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
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 @@ -175,12 +175,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

0 comments on commit ee76d3d

Please sign in to comment.