Verify Cordelia is no longer subscribed inside attempt_unsubscribe_of_principal().

Before this change, we were doing assertNotIn to verify that Cordelia
was not among our subscribers after calling /json/subscriptions/remove,
but we were then catching the AssertionError except for every case.  We
really only want to bypass the assertion when the server had reported
an error.

(imported from commit 0bdaf23047b795721372251724228daf18677df5)
This commit is contained in:
Steve Howell 2014-01-31 12:08:23 -05:00
parent ea934cf286
commit e2a6adc143
1 changed files with 4 additions and 7 deletions

View File

@ -326,13 +326,10 @@ class StreamAdminTest(AuthedTestCase):
{"subscriptions": ujson.dumps([stream.name]),
"principals": ujson.dumps([other_email])})
try:
# If the removal was successful, check that the principal is no
# longer subbed.
self.assertNotIn(other_user_profile, self.users_subscribed_to_stream(
stream_name, other_user_profile.realm.domain))
except AssertionError:
pass
# If the removal succeeded, then assert that Cordelia is no longer subscribed.
if result.status_code not in [400]:
subbed_users = self.users_subscribed_to_stream(stream_name, other_user_profile.realm.domain)
self.assertNotIn(other_user_profile, subbed_users)
return result