Fixes #2406. Fix KeyError when building details template.#2407
Fixes #2406. Fix KeyError when building details template.#2407
Conversation
a55c794 to
cee4130
Compare
|
Hey @miketaylr, TravisCI finished with status |
|
r? @karlcow |
karlcow
left a comment
There was a problem hiding this comment.
Hmm I missed that too. My bad. I had one job.
It's not testable by hand.
And there's nothing in unittest testing that.
@miketaylr Could we add a test in https://github.com/webcompat/webcompat.com/blob/cee41305fc5cda09652bd3da4e6f793320d51274/tests/unit/test_form.py for build_details.
Thanks.
Ah yes, let me do that. Tests++ |
|
ok! tests added (also for |
karlcow
left a comment
There was a problem hiding this comment.
Thanks for the tests @miketaylr
Really cool.
You can auto-merge after changing the variable names. Tests are passing.
| self.assertEqual(actual, expected) | ||
| actual_json = form.get_details(json.dumps({'a': 'b', 'c': False})) | ||
| expected_json = '<li>a: b</li><li>c: false</li>' | ||
| self.assertEqual(actual_json, expected_json) |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
| """Assert we return the expected HTML, for a json object or a string.""" | ||
| actual_json = form.build_details(json.dumps({'a': 'b', 'c': False})) | ||
| expected_json = '<details>\n<summary>Browser Configuration</summary>\n<ul>\n <li>a: b</li><li>c: false</li>\n</ul>\n</details>' # nopep8 | ||
| self.assertEqual(actual_json, expected_json) |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
06fcc63 to
014f7e4
Compare
My bad...