Make events test more robust for apply_events calls.
Make events test more robust for apply_events calls.

We now make tests that call EventsRegisterTest.do_test()
explicitly specify whether calls to apply_events() would
change the state of initially fetched data.  Generally
these tests exist to test that logic (as well as verifying
schemas of events), so if they stop testing that logic, it
is usually a broken test.

Some tests are exempted from the check here, because I think
they don't really change state--such as updating messages or
notifications.  You can set state_change_expected to False
for those tests.

For all the tests that deal with flipping boolean flags, I
set their value to False before calling do_test twice now.

For the authentication backends, I mock the settings so that
more backends are "supported" and therefore part of the event
and the fetched state.

Finally, for the bot tests, I make sure to use a bot the user
can access.

susansls/zulip,jackrzhang/zulip,christi3k/zulip,Galexrt/zulip,jphilipsen05/zulip,SmartPeople/zulip,jackrzhang/zulip,mahim97/zulip,verma-varsha/zulip,SmartPeople/zulip,vabs22/zulip,rishig/zulip,vabs22/zulip,andersk/zulip,punchagan/zulip,christi3k/zulip,brainwane/zulip,aakash-cr7/zulip,eeshangarg/zulip,brockwhittaker/zulip,vabs22/zulip,jainayush975/zulip,brockwhittaker/zulip,Galexrt/zulip,dawran6/zulip,zulip/zulip,kou/zulip,PhilSk/zulip,amanharitsh123/zulip,j831/zulip,JPJPJPOPOP/zulip,rishig/zulip,brockwhittaker/zulip,amanharitsh123/zulip,shubhamdhama/zulip,dhcrzf/zulip,souravbadami/zulip,hackerkid/zulip,rishig/zulip,andersk/zulip,jainayush975/zulip,verma-varsha/zulip,dhcrzf/zulip,jrowan/zulip,JPJPJPOPOP/zulip,hackerkid/zulip,aakash-cr7/zulip,shubhamdhama/zulip,rishig/zulip,amanharitsh123/zulip,tommyip/zulip,PhilSk/zulip,synicalsyntax/zulip,verma-varsha/zulip,dattatreya303/zulip,blaze225/zulip,jrowan/zulip,synicalsyntax/zulip,ryanbackman/zulip,verma-varsha/zulip,blaze225/zulip,hackerkid/zulip,j831/zulip,samatdav/zulip,zulip/zulip,timabbott/zulip,samatdav/zulip,jainayush975/zulip,jphilipsen05/zulip,Galexrt/zulip,samatdav/zulip,christi3k/zulip,rht/zulip,christi3k/zulip,dawran6/zulip,jackrzhang/zulip,zulip/zulip,susansls/zulip,tommyip/zulip,showell/zulip,timabbott/zulip,ryanbackman/zulip,dhcrzf/zulip,dhcrzf/zulip,kou/zulip,ryanbackman/zulip,vaidap/zulip,SmartPeople/zulip,kou/zulip,timabbott/zulip,rishig/zulip,aakash-cr7/zulip,amanharitsh123/zulip,SmartPeople/zulip,andersk/zulip,souravbadami/zulip,souravbadami/zulip,dawran6/zulip,shubhamdhama/zulip,rht/zulip,blaze225/zulip,zulip/zulip,mahim97/zulip,rht/zulip,brockwhittaker/zulip,rht/zulip,synicalsyntax/zulip,shubhamdhama/zulip,timabbott/zulip,j831/zulip,vabs22/zulip,dhcrzf/zulip,dhcrzf/zulip,mahim97/zulip,dattatreya303/zulip,verma-varsha/zulip,punchagan/zulip,andersk/zulip,JPJPJPOPOP/zulip,j831/zulip,Galexrt/zulip,hackerkid/zulip,timabbott/zulip,eeshangarg/zulip,dattatreya303/zulip,eeshangarg/zulip,jackrzhang/zulip,christi3k/zulip,vabs22/zulip,jrowan/zulip,timabbott/zulip,PhilSk/zulip,brainwane/zulip,showell/zulip,kou/zulip,vaidap/zulip,kou/zulip,susansls/zulip,timabbott/zulip,vabs22/zulip,mahim97/zulip,jrowan/zulip,rht/zulip,JPJPJPOPOP/zulip,PhilSk/zulip,verma-varsha/zulip,mahim97/zulip,jackrzhang/zulip,synicalsyntax/zulip,j831/zulip,shubhamdhama/zulip,rht/zulip,jphilipsen05/zulip,rht/zulip,samatdav/zulip,eeshangarg/zulip,Galexrt/zulip,shubhamdhama/zulip,vaidap/zulip,punchagan/zulip,hackerkid/zulip,JPJPJPOPOP/zulip,showell/zulip,souravbadami/zulip,SmartPeople/zulip,jainayush975/zulip,kou/zulip,dattatreya303/zulip,brainwane/zulip,showell/zulip,amanharitsh123/zulip,eeshangarg/zulip,rishig/zulip,brockwhittaker/zulip,synicalsyntax/zulip,jrowan/zulip,jphilipsen05/zulip,jphilipsen05/zulip,zulip/zulip,tommyip/zulip,blaze225/zulip,punchagan/zulip,dawran6/zulip,j831/zulip,brainwane/zulip,blaze225/zulip,vaidap/zulip,rishig/zulip,brainwane/zulip,eeshangarg/zulip,andersk/zulip,Galexrt/zulip,synicalsyntax/zulip,SmartPeople/zulip,zulip/zulip,brainwane/zulip,dawran6/zulip,tommyip/zulip,showell/zulip,tommyip/zulip,ryanbackman/zulip,showell/zulip,susansls/zulip,amanharitsh123/zulip,eeshangarg/zulip,samatdav/zulip,vaidap/zulip,blaze225/zulip,tommyip/zulip,jainayush975/zulip,hackerkid/zulip,punchagan/zulip,punchagan/zulip,mahim97/zulip,vaidap/zulip,shubhamdhama/zulip,jackrzhang/zulip,jainayush975/zulip,susansls/zulip,punchagan/zulip,synicalsyntax/zulip,ryanbackman/zulip,zulip/zulip,aakash-cr7/zulip,aakash-cr7/zulip,andersk/zulip,christi3k/zulip,aakash-cr7/zulip,ryanbackman/zulip,dattatreya303/zulip,jackrzhang/zulip,souravbadami/zulip,brainwane/zulip,samatdav/zulip,brockwhittaker/zulip,kou/zulip,jrowan/zulip,susansls/zulip,tommyip/zulip,souravbadami/zulip,showell/zulip,JPJPJPOPOP/zulip,dawran6/zulip,jphilipsen05/zulip,PhilSk/zulip,PhilSk/zulip,hackerkid/zulip,andersk/zulip,dhcrzf/zulip,dattatreya303/zulip,Galexrt/zulip