Skip to content

Commit

Permalink
requirements: Update sqlalchemy to 1.2.4.
Browse files Browse the repository at this point in the history
This requires updating one of the tests for the group_pm_with feature
in test_narrow to use the new style of tautology generated by SQLAlchemy.

Thanks to Sinwar for investigating this.

Fixes zulip#8381.
  • Loading branch information
timabbott committed Feb 27, 2018
1 parent 227e5fd commit 68664ac
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion requirements/common.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ipython==6.2.1
Pillow==5.0.0

# Needed for building complex DB queries
SQLAlchemy==1.1.14
SQLAlchemy==1.2.4

# Needed for password hashing
argon2-cffi==18.1.0
Expand Down
2 changes: 1 addition & 1 deletion requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ sourcemap==0.2.1
sphinx-rtd-theme==0.2.4
sphinx==1.7.0
sphinxcontrib-websupport==1.0.1 # via sphinx
sqlalchemy==1.1.14
sqlalchemy==1.2.4
statsd==3.2.1 # via django-statsd-mozilla
stripe==1.77.2
tblib==1.3.2
Expand Down
2 changes: 1 addition & 1 deletion requirements/prod.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ social-auth-app-django==2.1.0
social-auth-core==1.5.0 # via social-auth-app-django
sockjs-tornado==1.0.3
sourcemap==0.2.1
sqlalchemy==1.1.14
sqlalchemy==1.2.4
statsd==3.2.1 # via django-statsd-mozilla
stripe==1.77.2
tornado==4.5.3
Expand Down
8 changes: 2 additions & 6 deletions zerver/tests/test_narrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,7 @@ def test_add_term_using_id_operator_and_negated(self) -> None: # NEGATED
def test_add_term_using_group_pm_operator_and_not_the_same_user_as_operand(self) -> None:
# Test wtihout any such group PM threads existing
term = dict(operator='group-pm-with', operand=self.example_email("othello"))
with mock.patch("sqlalchemy.util.warn") as mock_warn:
self._do_add_term_test(term, 'WHERE recipient_id != recipient_id')

# SQLalchemy warns because this query is a tautology.
mock_warn.assert_called_once()
self._do_add_term_test(term, 'WHERE 1 != 1')

# Test with at least one such group PM thread existing
self.send_huddle_message(self.user_profile.email, [self.example_email("othello"),
Expand All @@ -237,7 +233,7 @@ def test_add_term_using_group_pm_operator_and_not_the_same_user_as_operand(self)
def test_add_term_using_group_pm_operator_not_the_same_user_as_operand_and_negated(
self) -> None: # NEGATED
term = dict(operator='group-pm-with', operand=self.example_email("othello"), negated=True)
self._do_add_term_test(term, 'WHERE recipient_id = recipient_id')
self._do_add_term_test(term, 'WHERE 1 = 1')

def test_add_term_using_group_pm_operator_with_non_existing_user_as_operand(self) -> None:
term = dict(operator='group-pm-with', operand='[email protected]')
Expand Down

0 comments on commit 68664ac

Please sign in to comment.