)]}'
{"openstack_dashboard/dashboards/settings/user/forms.py":[{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"39fee074a8509e08c701d065e598579aee0de805","unresolved":false,"context_lines":[{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    @staticmethod"},{"line_number":44,"context_line":"    def _sorted_zones():"},{"line_number":45,"context_line":"        d \u003d datetime(datetime.today().year, datetime.today().month, datetime.today().day)"},{"line_number":46,"context_line":"        zones \u003d [(tz, pytz.timezone(tz).localize(d).strftime(\u0027%z\u0027))"},{"line_number":47,"context_line":"                 for tz in pytz.common_timezones]"},{"line_number":48,"context_line":"        zones.sort(key\u003dlambda zone: int(zone[1]))"}],"source_content_type":"text/x-python","patch_set":1,"id":"5fc1f717_2b4b9e5f","line":45,"range":{"start_line":45,"start_character":0,"end_line":45,"end_character":89},"updated":"2019-04-02 16:03:00.000000000","message":"Please, change to:\n\ntoday \u003d datetime.today()\nd \u003d datetime(today.year, today.month, today.day)\n\nto omit code duplication","commit_id":"6206bc290ebd73c35ebe118612f75e6fd8567f3d"},{"author":{"_account_id":7130,"name":"David Hill","email":"davidchill@hotmail.com","username":"dhill"},"change_message_id":"071652154a11e282fc4dfc6608541ecbaf9f1d78","unresolved":false,"context_lines":[{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    @staticmethod"},{"line_number":44,"context_line":"    def _sorted_zones():"},{"line_number":45,"context_line":"        d \u003d datetime(datetime.today().year, datetime.today().month, datetime.today().day)"},{"line_number":46,"context_line":"        zones \u003d [(tz, pytz.timezone(tz).localize(d).strftime(\u0027%z\u0027))"},{"line_number":47,"context_line":"                 for tz in pytz.common_timezones]"},{"line_number":48,"context_line":"        zones.sort(key\u003dlambda zone: int(zone[1]))"}],"source_content_type":"text/x-python","patch_set":1,"id":"5fc1f717_cb221a02","line":45,"range":{"start_line":45,"start_character":0,"end_line":45,"end_character":89},"in_reply_to":"5fc1f717_2b4b9e5f","updated":"2019-04-02 16:30:02.000000000","message":"Done","commit_id":"6206bc290ebd73c35ebe118612f75e6fd8567f3d"},{"author":{"_account_id":27822,"name":"pengyuesheng","email":"pengyuesheng@gohighsec.com","username":"pengyuesheng"},"change_message_id":"78c8dc282ce869f0326c3b36899229fae14390d2","unresolved":false,"context_lines":[{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    @staticmethod"},{"line_number":44,"context_line":"    def _sorted_zones():"},{"line_number":45,"context_line":"        today \u003d  datetime.today()"},{"line_number":46,"context_line":"        d \u003d datetime(today.year, today.month, today.day)"},{"line_number":47,"context_line":"        zones \u003d [(tz, pytz.timezone(tz).localize(d).strftime(\u0027%z\u0027))"},{"line_number":48,"context_line":"                 for tz in pytz.common_timezones]"}],"source_content_type":"text/x-python","patch_set":2,"id":"5fc1f717_3f63cfdf","line":45,"range":{"start_line":45,"start_character":15,"end_line":45,"end_character":17},"updated":"2019-04-03 07:44:46.000000000","message":"multiple spaces after operator","commit_id":"539d5bd8c9b0dc6a729819122df23502e45305eb"},{"author":{"_account_id":7130,"name":"David Hill","email":"davidchill@hotmail.com","username":"dhill"},"change_message_id":"fb46ec268049875d5a3a3445bbe38c8b1829b0af","unresolved":false,"context_lines":[{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    @staticmethod"},{"line_number":44,"context_line":"    def _sorted_zones():"},{"line_number":45,"context_line":"        today \u003d  datetime.today()"},{"line_number":46,"context_line":"        d \u003d datetime(today.year, today.month, today.day)"},{"line_number":47,"context_line":"        zones \u003d [(tz, pytz.timezone(tz).localize(d).strftime(\u0027%z\u0027))"},{"line_number":48,"context_line":"                 for tz in pytz.common_timezones]"}],"source_content_type":"text/x-python","patch_set":2,"id":"5fc1f717_bd826251","line":45,"range":{"start_line":45,"start_character":15,"end_line":45,"end_character":17},"in_reply_to":"5fc1f717_3f63cfdf","updated":"2019-04-03 13:28:00.000000000","message":"Done","commit_id":"539d5bd8c9b0dc6a729819122df23502e45305eb"}],"openstack_dashboard/dashboards/settings/user/tests.py":[{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"e61120708ba0e98e9dd22758f09a782795238f33","unresolved":false,"context_lines":[{"line_number":28,"context_line":"    def test_timezone_offset_is_displayed(self):"},{"line_number":29,"context_line":"        res \u003d self.client.get(INDEX_URL)"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"        if time.localtime().tm_isdst \u003d\u003d 1:"},{"line_number":32,"context_line":"            self.assertContains(res, \"UTC +10:00: Australia (Melbourne) Time\")"},{"line_number":33,"context_line":"        else:"},{"line_number":34,"context_line":"            self.assertContains(res, \"UTC +11:00: Australia (Melbourne) Time\")"}],"source_content_type":"text/x-python","patch_set":9,"id":"9fb8cfa7_b2564206","line":31,"range":{"start_line":31,"start_character":7,"end_line":31,"end_character":42},"updated":"2019-06-04 03:56:01.000000000","message":"Unit test should be deterministic. It is not a good idea to change what is tested dynamically. In this case, you need two types of tests (for tm_isdst True and False) instead of using the condition.","commit_id":"63eeae19c6517002a7e271e6d7ab4ef00c12b67c"},{"author":{"_account_id":7130,"name":"David Hill","email":"davidchill@hotmail.com","username":"dhill"},"change_message_id":"fb610d6be1e549ef888bbbd13a5600c4f4d116a3","unresolved":false,"context_lines":[{"line_number":28,"context_line":"    def test_timezone_offset_is_displayed(self):"},{"line_number":29,"context_line":"        res \u003d self.client.get(INDEX_URL)"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"        if time.localtime().tm_isdst \u003d\u003d 1:"},{"line_number":32,"context_line":"            self.assertContains(res, \"UTC +10:00: Australia (Melbourne) Time\")"},{"line_number":33,"context_line":"        else:"},{"line_number":34,"context_line":"            self.assertContains(res, \"UTC +11:00: Australia (Melbourne) Time\")"}],"source_content_type":"text/x-python","patch_set":9,"id":"9fb8cfa7_29750dfb","line":31,"range":{"start_line":31,"start_character":7,"end_line":31,"end_character":42},"in_reply_to":"9fb8cfa7_068ef82d","updated":"2019-06-18 14:31:09.000000000","message":"The problem with this test is that we depend on a sel.client.get that returns the *current* daylight/standard time at the time of this test execution.   Unless we can inject the current date to that request, it\u0027ll always return the *current* daylight/standard time.   My initial user test would simply make sure that on DST, we get +10 and on ST we get +11.  There\u0027re no other ways of testing that unless we modify the initial client request to post a date to the form and validate it returns the expected value for that date ...   What else can we do ?","commit_id":"63eeae19c6517002a7e271e6d7ab4ef00c12b67c"},{"author":{"_account_id":25820,"name":"Marc","email":"mb.methot@gmail.com","username":"mmethot"},"change_message_id":"4957a2fdfdd9a6496bd75177daeb21fb1a866108","unresolved":false,"context_lines":[{"line_number":28,"context_line":"    def test_timezone_offset_is_displayed(self):"},{"line_number":29,"context_line":"        res \u003d self.client.get(INDEX_URL)"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"        if time.localtime().tm_isdst \u003d\u003d 1:"},{"line_number":32,"context_line":"            self.assertContains(res, \"UTC +10:00: Australia (Melbourne) Time\")"},{"line_number":33,"context_line":"        else:"},{"line_number":34,"context_line":"            self.assertContains(res, \"UTC +11:00: Australia (Melbourne) Time\")"}],"source_content_type":"text/x-python","patch_set":9,"id":"9fb8cfa7_b3522d3a","line":31,"range":{"start_line":31,"start_character":7,"end_line":31,"end_character":42},"in_reply_to":"9fb8cfa7_337cfd1d","updated":"2019-06-12 13:36:33.000000000","message":"To be more deterministic, so that you don\u0027t do a catch all, perhaps simply change the else to an elif","commit_id":"63eeae19c6517002a7e271e6d7ab4ef00c12b67c"},{"author":{"_account_id":7130,"name":"David Hill","email":"davidchill@hotmail.com","username":"dhill"},"change_message_id":"c39d887fd93b09cbbe33a042614655c8531978b1","unresolved":false,"context_lines":[{"line_number":28,"context_line":"    def test_timezone_offset_is_displayed(self):"},{"line_number":29,"context_line":"        res \u003d self.client.get(INDEX_URL)"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"        if time.localtime().tm_isdst \u003d\u003d 1:"},{"line_number":32,"context_line":"            self.assertContains(res, \"UTC +10:00: Australia (Melbourne) Time\")"},{"line_number":33,"context_line":"        else:"},{"line_number":34,"context_line":"            self.assertContains(res, \"UTC +11:00: Australia (Melbourne) Time\")"}],"source_content_type":"text/x-python","patch_set":9,"id":"9fb8cfa7_b8f68a62","line":31,"range":{"start_line":31,"start_character":7,"end_line":31,"end_character":42},"in_reply_to":"9fb8cfa7_b2564206","updated":"2019-06-12 12:47:09.000000000","message":"So how would you do this ?   I mean, this test gets an URL and makes sure there\u0027s a given string in it... Without this test, we have to either rewrite everything or find a more elegant solution ... but I know, this tests could fail when we change from EST to EDT or something like that.","commit_id":"63eeae19c6517002a7e271e6d7ab4ef00c12b67c"},{"author":{"_account_id":7130,"name":"David Hill","email":"davidchill@hotmail.com","username":"dhill"},"change_message_id":"03bda954b0487ed4115ea4b2db1791fc8ecf1f7e","unresolved":false,"context_lines":[{"line_number":28,"context_line":"    def test_timezone_offset_is_displayed(self):"},{"line_number":29,"context_line":"        res \u003d self.client.get(INDEX_URL)"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"        if time.localtime().tm_isdst \u003d\u003d 1:"},{"line_number":32,"context_line":"            self.assertContains(res, \"UTC +10:00: Australia (Melbourne) Time\")"},{"line_number":33,"context_line":"        else:"},{"line_number":34,"context_line":"            self.assertContains(res, \"UTC +11:00: Australia (Melbourne) Time\")"}],"source_content_type":"text/x-python","patch_set":9,"id":"9fb8cfa7_ee267768","line":31,"range":{"start_line":31,"start_character":7,"end_line":31,"end_character":42},"in_reply_to":"9fb8cfa7_b3522d3a","updated":"2019-06-12 17:26:40.000000000","message":"I don\u0027t think that\u0027s what Mr. Motoki meant.   We have to be able to test a specific date to see if daylight saving times is applied or not on that timezone.  Putting an elif, an else or whatever here won\u0027t solve that issue.   This test isn\u0027t good (I know it from the beginning) but other than rewritting the whole test as well as adding a date field that we can use to push the date we want to test to the _sorted_tz function in order to validate if the returned value is the expected one is the only other GOOD way of testing this.   And I\u0027m not sure doing that worths the hassle ... I might just remove that test and go on with life .","commit_id":"63eeae19c6517002a7e271e6d7ab4ef00c12b67c"},{"author":{"_account_id":7130,"name":"David Hill","email":"davidchill@hotmail.com","username":"dhill"},"change_message_id":"2aa97a8f883b0fff9eca7bf5d2a595fbb0772844","unresolved":false,"context_lines":[{"line_number":28,"context_line":"    def test_timezone_offset_is_displayed(self):"},{"line_number":29,"context_line":"        res \u003d self.client.get(INDEX_URL)"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"        if time.localtime().tm_isdst \u003d\u003d 1:"},{"line_number":32,"context_line":"            self.assertContains(res, \"UTC +10:00: Australia (Melbourne) Time\")"},{"line_number":33,"context_line":"        else:"},{"line_number":34,"context_line":"            self.assertContains(res, \"UTC +11:00: Australia (Melbourne) Time\")"}],"source_content_type":"text/x-python","patch_set":9,"id":"9fb8cfa7_337cfd1d","line":31,"range":{"start_line":31,"start_character":7,"end_line":31,"end_character":42},"in_reply_to":"9fb8cfa7_b8f68a62","updated":"2019-06-12 13:17:16.000000000","message":"Without calling directly the functions from views.py or injecting date in the forms, this is not possible .  Should I simply remove the australia timezone check ?","commit_id":"63eeae19c6517002a7e271e6d7ab4ef00c12b67c"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"2a6607e48e0967496b06934b24c5a6ffe1333b40","unresolved":false,"context_lines":[{"line_number":28,"context_line":"    def test_timezone_offset_is_displayed(self):"},{"line_number":29,"context_line":"        res \u003d self.client.get(INDEX_URL)"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"        if time.localtime().tm_isdst \u003d\u003d 1:"},{"line_number":32,"context_line":"            self.assertContains(res, \"UTC +10:00: Australia (Melbourne) Time\")"},{"line_number":33,"context_line":"        else:"},{"line_number":34,"context_line":"            self.assertContains(res, \"UTC +11:00: Australia (Melbourne) Time\")"}],"source_content_type":"text/x-python","patch_set":9,"id":"9fb8cfa7_068ef82d","line":31,"range":{"start_line":31,"start_character":7,"end_line":31,"end_character":42},"in_reply_to":"9fb8cfa7_ee267768","updated":"2019-06-18 13:44:17.000000000","message":"What I would like to suggest is to cover both cases of tm_isdst True and False. You can do this by mocking time.localtime method. I am not sure the result depends on the result of tm_isdst or not now, so my comment might be wrong. However, the current approach means that if someone in non DST timezone L.32 is never tested and vice versa.","commit_id":"63eeae19c6517002a7e271e6d7ab4ef00c12b67c"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"1e46739d5357899dd8373113ccb27ca76324f44e","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    def test_timezone_offset_is_displayed(self):"},{"line_number":27,"context_line":"        res \u003d self.client.get(INDEX_URL)"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"        self.assertContains(res, \"UTC -03:00: Falkland Islands Time\")"},{"line_number":30,"context_line":"        self.assertContains(res, \"UTC -10:00: United States (Honolulu) Time\")"},{"line_number":31,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"9fb8cfa7_26d9bc21","line":28,"updated":"2019-06-18 13:46:55.000000000","message":"Although I am okay to drop Australian timezone check, could you add a test code to cover you change? It means if you are in timezone with DST, DST string is used and otherwise non-DST timezone string is used. In addition, for areas without DST, what is the expected behavior?","commit_id":"a3e8dc7a73bf05893ba6513a64dd774bcfccf6bb"},{"author":{"_account_id":7130,"name":"David Hill","email":"davidchill@hotmail.com","username":"dhill"},"change_message_id":"fb610d6be1e549ef888bbbd13a5600c4f4d116a3","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    def test_timezone_offset_is_displayed(self):"},{"line_number":27,"context_line":"        res \u003d self.client.get(INDEX_URL)"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"        self.assertContains(res, \"UTC -03:00: Falkland Islands Time\")"},{"line_number":30,"context_line":"        self.assertContains(res, \"UTC -10:00: United States (Honolulu) Time\")"},{"line_number":31,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"9fb8cfa7_49a88176","line":28,"in_reply_to":"9fb8cfa7_26d9bc21","updated":"2019-06-18 14:31:09.000000000","message":"Well in order to do that, I would have to modify the _sort_timezone function wouldn\u0027t I ?  The function only return UTC +11:00 or UTC +10:00 which I kind of tested with my initial test but it would only be tested when the date was set to the proper date.   I\u0027m not sure to understand your mock comment as I would still have to mock the other function wouldn\u0027t I ?","commit_id":"a3e8dc7a73bf05893ba6513a64dd774bcfccf6bb"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"5a7c6555d837fe0d194cef545df99cf8112cadb8","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    def test_timezone_offset_is_displayed(self):"},{"line_number":27,"context_line":"        res \u003d self.client.get(INDEX_URL)"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"        self.assertContains(res, \"UTC -03:00: Falkland Islands Time\")"},{"line_number":30,"context_line":"        self.assertContains(res, \"UTC -10:00: United States (Honolulu) Time\")"},{"line_number":31,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"9fb8cfa7_1b3f1dd7","line":28,"in_reply_to":"9fb8cfa7_49a88176","updated":"2019-06-19 08:48:42.000000000","message":"What I think is to mock datetime.today() function in forms.py.\nWe can setup the mock to return Jan 1 (non DST) and Aug 1 (DST). By this way we can test DST and non-DST cases.\nDoes it work for you?\n\nNote that we cannot mock datetime.today directly (as mock can\u0027t set attributes of built-in/extension type). If you go to this route, you need to introduce a shim function which just calls datetime.today().","commit_id":"a3e8dc7a73bf05893ba6513a64dd774bcfccf6bb"}],"test-requirements.txt":[{"author":{"_account_id":29313,"name":"Vishal Manchanda","email":"manchandavishal143@gmail.com","username":"vishalmanchanda"},"change_message_id":"1abae0e846c12f5c6c7abd16e3de654841e8ad61","unresolved":false,"context_lines":[{"line_number":13,"context_line":"bandit!\u003d1.6.0,\u003e\u003d1.4.0 # Apache-2.0"},{"line_number":14,"context_line":"coverage!\u003d4.4,\u003e\u003d4.0 # Apache-2.0"},{"line_number":15,"context_line":"flake8-import-order\u003d\u003d0.12 # LGPLv3"},{"line_number":16,"context_line":"freezegun\u003e\u003d0.3.6 # Apache-2.0"},{"line_number":17,"context_line":"mock\u003e\u003d2.0.0 # BSD"},{"line_number":18,"context_line":"mox3\u003e\u003d0.20.0 # Apache-2.0"},{"line_number":19,"context_line":"nodeenv\u003e\u003d0.9.4 # BSD"}],"source_content_type":"text/plain","patch_set":13,"id":"bf51134e_8604d94b","line":16,"range":{"start_line":16,"start_character":0,"end_line":16,"end_character":29},"updated":"2020-07-10 08:35:41.000000000","message":"You have to include this requirement into \u0027lower-constraints.txt\u0027 as well.","commit_id":"efa5df396c89b46fcbc3d1658ff73e0a6bbbb447"},{"author":{"_account_id":29313,"name":"Vishal Manchanda","email":"manchandavishal143@gmail.com","username":"vishalmanchanda"},"change_message_id":"393d98b175774d8d030dcedf6fc5bf8a1b009498","unresolved":false,"context_lines":[{"line_number":14,"context_line":"coverage!\u003d4.4,\u003e\u003d4.0 # Apache-2.0"},{"line_number":15,"context_line":"flake8-import-order\u003d\u003d0.12 # LGPLv3"},{"line_number":16,"context_line":"freezegun\u003e\u003d0.3.6 # Apache-2.0"},{"line_number":17,"context_line":"mock\u003e\u003d2.0.0 # BSD"},{"line_number":18,"context_line":"mox3\u003e\u003d0.20.0 # Apache-2.0"},{"line_number":19,"context_line":"nodeenv\u003e\u003d0.9.4 # BSD"},{"line_number":20,"context_line":"pytest\u003e\u003d5.3.5 # MIT"},{"line_number":21,"context_line":"pytest-django\u003e\u003d3.8.0 # BSD (3 clause)"}],"source_content_type":"text/plain","patch_set":13,"id":"bf51134e_862859e2","line":18,"range":{"start_line":17,"start_character":0,"end_line":18,"end_character":25},"updated":"2020-07-10 08:28:13.000000000","message":"These requirements look unnecessary. Could you remove it?","commit_id":"efa5df396c89b46fcbc3d1658ff73e0a6bbbb447"}]}
