test_classes: Use realistic web and mobile User-Agent strings.

This fixes a confusing aspect of how our automated tests worked
previously, where we'd almost all HTTP requests in the unlikely
configuration with no User-Agent string specified.

We need to adjust query counts in a few tests that now are a bit
cheaper because they now can take advantage of a Client object created
in server_initialization.py in `process_client`.
This commit is contained in:
Tim Abbott
2020-02-24 17:53:12 -08:00
parent 27b267026e
commit 27edc18330
4 changed files with 26 additions and 6 deletions

View File

@@ -78,7 +78,7 @@ class CompatibilityTest(ZulipTestCase):
'''.strip().split('\n') if case]
def test_compatibility_without_user_agent(self) -> None:
result = self.client_get("/compatibility")
result = self.client_get("/compatibility", skip_user_agent=True)
self.assert_json_error(result, 'User-Agent header missing from request')
def test_compatibility(self) -> None: