Skip to content
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

Fixed #18314.request.build_absolute_uri() finally functions correctly #1314

Closed
wants to merge 15 commits into from
Closed

Conversation

ArcTanSusan
Copy link
Contributor

https://code.djangoproject.com/ticket/18314 In "django/http", request.build_absolute_uri() finally functions correctly when path starts with "//". Thanks SmileyChris and yoyoma for work on the patches. I manually applied the "18314.diff" patch given by SmileyChris. The tests in "tests/http/" failed before the patch was implemented, and then the tests succeeded after the patch was implemented. Please code review and let me know how I can make this PR better.

mjtamlyn and others added 15 commits June 22, 2013 04:19
Fixed #18872 -- Added prefix to FormMixin
Fixed #20587 -- Made convert_values handle None values
…l-Forms .po file headers.

Thanks naktinis for the report and initial patch.
The code examples should now work correctly.
The `get_context_data` method in the examples was changed when
necessary to adopt a singular style (get context with super(...),
add the extra keys to the dict then return it).

Thanks to Remco Wendt for the initial report and to Tim Graham
for the review.
Thanks to Michal Sládek for the report and initial patch,
and to loic84 for the review.
Thanks to Tim Graham for the report and review.
In Django < 1.6, override_settings restores the settings module that was
active when the override_settings call was executed, not when it was
run. This can make a difference when override_settings is applied to a
class, since it's executed when the module is imported, not when the
test case is run.

In addition, if the settings module for tests is stored alongside the
tests themselves, importing the settings module can trigger an import
of the tests. Since the settings module isn't fully imported yet,
class-level override_settings statements may store a reference to an
incorrect settings module. Eventually this will result in a crash during
test teardown because the settings module restored by override_settings
won't the one that was active during test setup.

While Django should prevent this situation in the future by failing
loudly in such dubious import sequences, that change won't be backported
to 1.5 and 1.4. However, these versions received the "allowed hosts"
patch and they're prone to "AttributeError: 'Settings' object has no
attribute '_original_allowed_hosts'". To mitigate this regression, this
commits stuffs _original_allowed_hosts on a random module instead of the
settings module.

This problem shouldn't occur in Django 1.6, see #20290, but this patch
will be forward-ported for extra safety.

Also tweaked backup variable names for consistency.

Forward port of 0261922 from stable/1.5.x.

Conflicts:
	django/test/utils.py
This is to allow future compatibility with work that is ongoing in the 2013 GSoC.
@timgraham
Copy link
Member

Please open a new PR if you can fix the tests, thanks.

@timgraham timgraham closed this Sep 6, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.