-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #2406. Fix KeyError when building details template. #2407
Conversation
a55c794
to
cee4130
Compare
Hey @miketaylr, TravisCI finished with status |
r? @karlcow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the tests @miketaylr
Really cool.
You can auto-merge after changing the variable names. Tests are passing.
tests/unit/test_form.py
Outdated
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.
tests/unit/test_form.py
Outdated
"""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...