{"action":"created","issue":{"url":"https://api.github.com/repos/zulip/zulip/issues/1381","repository_url":"https://api.github.com/repos/zulip/zulip","labels_url":"https://api.github.com/repos/zulip/zulip/issues/1381/labels{/name}","comments_url":"https://api.github.com/repos/zulip/zulip/issues/1381/comments","events_url":"https://api.github.com/repos/zulip/zulip/issues/1381/events","html_url":"https://github.com/zulip/zulip/issues/1381","id":167193886,"node_id":"MDU6SXNzdWUxNjcxOTM4ODY=","number":1381,"title":"Add test helpers for calls to get_messages_backend()","user":{"login":"showell","id":142908,"node_id":"MDQ6VXNlcjE0MjkwOA==","avatar_url":"https://avatars2.githubusercontent.com/u/142908?v=4","gravatar_id":"","url":"https://api.github.com/users/showell","html_url":"https://github.com/showell","followers_url":"https://api.github.com/users/showell/followers","following_url":"https://api.github.com/users/showell/following{/other_user}","gists_url":"https://api.github.com/users/showell/gists{/gist_id}","starred_url":"https://api.github.com/users/showell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/showell/subscriptions","organizations_url":"https://api.github.com/users/showell/orgs","repos_url":"https://api.github.com/users/showell/repos","events_url":"https://api.github.com/users/showell/events{/privacy}","received_events_url":"https://api.github.com/users/showell/received_events","type":"User","site_admin":false},"labels":[{"id":265733017,"node_id":"MDU6TGFiZWwyNjU3MzMwMTc=","url":"https://api.github.com/repos/zulip/zulip/labels/area:%20testing-coverage","name":"area: testing-coverage","color":"bfd4f2","default":false},{"id":265216832,"node_id":"MDU6TGFiZWwyNjUyMTY4MzI=","url":"https://api.github.com/repos/zulip/zulip/labels/help%20wanted","name":"help wanted","color":"159818","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-23T17:18:13Z","updated_at":"2018-06-12T15:32:48Z","closed_at":"2018-06-12T15:32:48Z","author_association":"CONTRIBUTOR","body":"We have this idiom in several places.\n\n```\n        with queries_captured() as all_queries:\n            get_old_messages_backend(request, user_profile)\n\n        # Verify the query for old messages looks correct.\n        queries = [q for q in all_queries if '/* get_old_messages */' in q['sql']]\n```\n\nThere are various messy ways of digging through the queries to find the ones at you want to look further at with `self.assertIn(cond, query)` type of statements.\n\nWe may want a helper method that takes the queries captured from `get_old_messages_backend` and inspects them for overall sanity and then puts the key queries into some kind of dictionary.  The trickiest bit here might be figuring out what exactly is a predictable sequence of queries from `get_old_messages_backend`.\n\nWe should do this after #1380 hits master (which should be soon).\n"},"comment":{"url":"https://api.github.com/repos/zulip/zulip/issues/comments/396633509","html_url":"https://github.com/zulip/zulip/issues/1381#issuecomment-396633509","issue_url":"https://api.github.com/repos/zulip/zulip/issues/1381","id":396633509,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NjYzMzUwOQ==","user":{"login":"showell","id":142908,"node_id":"MDQ6VXNlcjE0MjkwOA==","avatar_url":"https://avatars2.githubusercontent.com/u/142908?v=4","gravatar_id":"","url":"https://api.github.com/users/showell","html_url":"https://github.com/showell","followers_url":"https://api.github.com/users/showell/followers","following_url":"https://api.github.com/users/showell/following{/other_user}","gists_url":"https://api.github.com/users/showell/gists{/gist_id}","starred_url":"https://api.github.com/users/showell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/showell/subscriptions","organizations_url":"https://api.github.com/users/showell/orgs","repos_url":"https://api.github.com/users/showell/repos","events_url":"https://api.github.com/users/showell/events{/privacy}","received_events_url":"https://api.github.com/users/showell/received_events","type":"User","site_admin":false},"created_at":"2018-06-12T15:32:48Z","updated_at":"2018-06-12T15:32:48Z","author_association":"CONTRIBUTOR","body":"Closing this as too low of a value-add, plus possibly obsolete."}}
{"actor":{"display_login":"showell"}}