summaryrefslogtreecommitdiff
path: root/django/contrib/contenttypes/tests.py
AgeCommit message (Collapse)Author
2014-06-16Added database migration for contrib.contenttypes.Tim Graham
Moved contenttypes tests to allow them to run correctly in the presence of migrations. refs #22170.
2014-01-26Moved RequestSite and get_current_site.Aymeric Augustin
Following the app-loading refactor, these objects must live outside of django.contrib.sites.models because they must be available without importing the django.contrib.sites.models module when django.contrib.sites isn't installed. Refs #21680. Thanks Carl and Loic for reporting this issue.
2013-12-23Imported override_settings from its new location.Aymeric Augustin
2013-12-23Dropped AppCache._empty, _with_app and _without_app.Aymeric Augustin
It's now easier to achieve the same effect with modify_settings or override_settings.
2013-12-22Moved apps back in the toplevel django namespace.Aymeric Augustin
Reverted 4a56a93cc458e9ab4dcab95d9f5067d4975dd1a2.
2013-12-22Removed the app_config.installed flag.Aymeric Augustin
Since applications that aren't installed no longer have an application configuration, it is now always True in practice. Provided an abstraction to temporarily add or remove applications as several tests messed with app_config.installed to achieve this effect. For now this API is _-prefixed because it looks dangerous.
2013-12-17Normalized Model._meta.installed.Aymeric Augustin
Used the information from the app cache instead of creating a duplicate based on INSTALLED_APPS. Model._meta.installed is no longer writable. It was a rather sketchy way to alter private internals anyway.
2013-11-03Fixed flake8 E251 violationsMilton Mazzarri
2013-10-31Started attackign the next flake8 violationAlex Gaynor
2013-10-18Fixed #21268 -- Fixed E303 pep8 warningsAlasdair Nicol
2013-05-18Fix NoneType error when fetching a stale ContentType with get_for_idDiederik van der Boor
When a stale ContentType is fetched, the _add_to_cache() function didn't detect that `model_class()` returns `None` (which it does by design). However, the `app_label` + `model` fields can be used instead to as local cache key. Third party apps can detect stale models by checking whether `model_class()` returns `None`. Ticket: https://code.djangoproject.com/ticket/20442
2013-02-19Added a new required ALLOWED_HOSTS setting for HTTP host header validation.Carl Meyer
This is a security fix; disclosure and advisory coming shortly.
2012-09-28Made more extensive use of get_current_siteClaude Paroz
Refs #15089
2012-08-12[py3] Refactored __unicode__ to __str__.Aymeric Augustin
* Renamed the __unicode__ methods * Applied the python_2_unicode_compatible decorator * Removed the StrAndUnicode mix-in that is superseded by python_2_unicode_compatible * Kept the __unicode__ methods in classes that specifically test it under Python 2
2012-07-22[py3] Updated urllib/urllib2/urlparse imports.Aymeric Augustin
Lots of functions were moved. Use explicit imports in all cases to keey it easy to identify where the functions come from.
2012-07-22[py3] Replaced unicode/str by six.text_type/bytes.Aymeric Augustin
2012-06-08Cleaned whitespace errors introduced in previous commitAnssi Kääriäinen
2012-06-08Fixed #18399 – Added a way to get ContentTypes for proxy modelsSimon Charette
Added kwargs for_concrete_model and for_concrete_models to ContentType methods get_for_model() and get_for_models(). By setting the flag to False, it is possible to get the contenttype for proxy models.
2012-06-07Fixed #18269 -- Applied unicode_literals for Python 3 compatibility.Claude Paroz
Thanks Vinay Sajip for the support of his django3 branch and Jannis Leidel for the review.
2012-03-30Removed with_statement imports, useless in Python >= 2.6. Refs #17965. ↵Claude Paroz
Thanks jonash for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17828 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-02-11Fixed #17256 -- Ensured that content types get cached when retrieved by ↵Julien Phalip
natural key. Thanks, defaultwombat and charettes. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17502 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-01-02Fixed #8997 -- Prevented the contenttypes `shortcut` view to hide errors ↵Julien Phalip
occurring inside the `get_absolute_url()` method. Thanks to Rob for the report and to joshlory, Aymeric Augustin and Claude Paroz for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17328 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-12Introduce `ContentType.objects.get_for_models(*models)` and use it in the ↵Alex Gaynor
the auth permissions code. This is a solid performance gain on the test suite. Thanks to ptone for the profiling to find this hotspot, and carl for the review. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16963 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-12Convert the contettypes tests to use self.assertNumQueries, rather than hand ↵Alex Gaynor
rolling their own version. Thanks to carl for the review. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16962 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-09-23Fixed #16917 -- Don't try to use the model name for a ContentType's unicode ↵Carl Meyer
representation if the model no longer exists. Thanks Ivan Sagalaev for report and patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16895 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-25Fixes #14543 -- ContentTypes tests failing if auth app is not installed. ↵Chris Beaven
Thanks for the work on the patch, sayane and crayz_train. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16101 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-04Fixed #15738 -- Removed unnecessary line in contrib.contenttypes tests. ↵Adrian Holovaty
Thanks, mitnk git-svn-id: http://code.djangoproject.com/svn/django/trunk@16013 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-17Fixed #15622 -- Clear content type cache to avoid problems with subsequence ↵Russell Keith-Magee
TransactionTestCases. Thanks to zyga for the report git-svn-id: http://code.djangoproject.com/svn/django/trunk@15867 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-07Fixed #15554 -- Corrected test failure in contenttypes when default site ↵Russell Keith-Magee
isn't example.com. Thanks to twil for the report, and PaulM for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15766 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-05Fixed #15111 -- Ensured that the auth, contenttypes and sitemaps tests will ↵Russell Keith-Magee
run when the sites app isn't installed. Thanks to Waldemar Kornewald for the report and draft patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15418 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-04Fixed #14386, #8960, #10235, #10909, #10608, #13845, #14377 - standardize ↵Luke Plant
Site/RequestSite usage in various places. Many thanks to gabrielhurley for putting most of this together. Also to bmihelac, arthurk, qingfeng, hvendelbo, petr.pulc@s-cape.cz, Hraban for reports and some initial patches. The patch also contains some whitespace/PEP8 fixes. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13980 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-10Beefed up caching of ContentType lookups by adding ↵Jacob Kaplan-Moss
ContentType.objects.get_for_id(). This shares the same cache as get_for_model(), and thus things that do lots of ctype lookups by ID will benefit. Refs #5570. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7216 bcc190cf-cafb-0310-a4f2-bffc1f526a37