-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Reformat Server-Timing headers to updated W3C spec. #1211
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
Reformat Server-Timing headers to updated W3C spec. #1211
Conversation
Thanks for the fix. Are you up for adding a test? |
Ah, I didn't realize that entire function has no test. I'll add one for that. |
@@ -92,6 +93,7 @@ class DebugToolbarIntegrationTestCase(TestCase): | |||
def test_middleware(self): | |||
response = self.client.get("/execute_sql/") | |||
self.assertEqual(response.status_code, 200) | |||
self.assertContains(response, "djDebug") |
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.
This caused the test to fail until the views returned a response containing </body>
.
tests/test_integration.py
Outdated
r'CachePanel_total_time;dur=0;desc="Cache 0 Calls"', | ||
] | ||
for expected in expected_partials: | ||
re.compile(expected).search(server_timing) |
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.
This is missing the assert.
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.
Cripes. Thanks for catching that.
Fixed basic integration tests. When there was no </body> tag the toolbar's middleware exited earlier and was never inserted.
Rebased on master. |
Codecov Report
@@ Coverage Diff @@
## master #1211 +/- ##
==========================================
+ Coverage 86.2% 86.41% +0.21%
==========================================
Files 25 25
Lines 1428 1428
Branches 204 204
==========================================
+ Hits 1231 1234 +3
+ Misses 143 141 -2
+ Partials 54 53 -1
Continue to review full report at Codecov.
|
Closes #1209