diff --git a/tools/test-backend b/tools/test-backend index b328da5165..fd8e114501 100755 --- a/tools/test-backend +++ b/tools/test-backend @@ -89,7 +89,6 @@ not_yet_fully_covered = { 'zerver/views/auth.py', 'zerver/views/home.py', 'zerver/views/registration.py', - 'zerver/views/events_register.py', # This one has 1 line that isn't covered in Python 3 'zerver/views/upload.py', # Getting this to 100% is a major project goal. diff --git a/zerver/tests/test_events.py b/zerver/tests/test_events.py index 09e24199f3..6e55432c01 100644 --- a/zerver/tests/test_events.py +++ b/zerver/tests/test_events.py @@ -92,7 +92,18 @@ import time import ujson from six.moves import range -class TornadoTest(ZulipTestCase): +class EventsEndpointTest(ZulipTestCase): + def test_events_register_endpoint(self): + # type: () -> None + + # This test is intended to get minimal coverage on + # zerver.views.events_register.events_register_backend, so we can have + # 100% views coverage. + email = 'hamlet@zulip.com' + with mock.patch('zerver.views.events_register.do_events_register', return_value={}): + result = self.client_post('/json/register', **self.api_auth(email)) + self.assert_json_success(result) + def test_tornado_endpoint(self): # type: () -> None