testing: Avoid class variables to enforce isolation.

Class variables are shared between all instances and as a result
changes made by one instance are leaked to other instances.
This commit is contained in:
Umair Khan 2017-05-24 11:33:30 +05:00 committed by Tim Abbott
parent 169f1e35b8
commit ebb9bd1a6a

View File

@ -340,8 +340,10 @@ class GetEventsTest(ZulipTestCase):
self.assertEqual(events[0]["message"]["display_recipient"], "Denmark")
class EventsRegisterTest(ZulipTestCase):
user_profile = get_user_profile_by_email('hamlet@zulip.com')
maxDiff = None # type: Optional[int]
def setUp(self):
super(EventsRegisterTest, self).setUp()
self.user_profile = self.example_user('hamlet')
self.maxDiff = None # type: Optional[int]
def create_bot(self, email):
# type: (str) -> UserProfile