Ticket #24124: 24124-complement.diff

File 24124-complement.diff, 7.4 KB (added by Aymeric Augustin, 9 years ago)
  • django/contrib/auth/tests/settings.py

    diff --git a/django/contrib/auth/tests/settings.py b/django/contrib/auth/tests/settings.py
    index 7697558..ce2aa7d 100644
    a b AUTH_TEMPLATES = [{  
    1515    'OPTIONS': {
    1616        'context_processors': (
    1717            'django.contrib.auth.context_processors.auth',
    18             'django.template.context_processors.debug',
    19             'django.template.context_processors.i18n',
    20             'django.template.context_processors.media',
    21             'django.template.context_processors.static',
    22             'django.template.context_processors.tz',
    2318            'django.contrib.messages.context_processors.messages',
    2419        ),
    2520    },
  • tests/admin_views/tests.py

    diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py
    index 04dfb09..f991982 100644
    a b class AdminViewBasicTest(AdminViewBasicTestCase):  
    800800    'OPTIONS': {
    801801        'context_processors': [
    802802            'django.template.context_processors.debug',
    803             'django.template.context_processors.i18n',
    804             'django.template.context_processors.tz',
    805             'django.template.context_processors.media',
    806             'django.template.context_processors.static',
     803            'django.template.context_processors.request',
    807804            'django.contrib.auth.context_processors.auth',
    808805            'django.contrib.messages.context_processors.messages',
    809806        ],
    class AdminDocsTest(TestCase):  
    44994496        'OPTIONS': {
    45004497            'context_processors': [
    45014498                'django.template.context_processors.debug',
    4502                 'django.template.context_processors.tz',
    4503                 'django.template.context_processors.media',
    4504                 'django.template.context_processors.static',
     4499                'django.template.context_processors.request',
    45054500                'django.contrib.auth.context_processors.auth',
    45064501                'django.contrib.messages.context_processors.messages',
    45074502            ],
  • tests/runtests.py

    diff --git a/tests/runtests.py b/tests/runtests.py
    index f742c57..f3ec640 100755
    a b def setup(verbosity, test_labels):  
    123123        'APP_DIRS': True,
    124124        'OPTIONS': {
    125125            'context_processors': [
    126                 'django.contrib.auth.context_processors.auth',
    127126                'django.template.context_processors.debug',
    128                 'django.template.context_processors.i18n',
    129                 'django.template.context_processors.media',
    130                 'django.template.context_processors.static',
    131                 'django.template.context_processors.tz',
     127                'django.template.context_processors.request',
     128                'django.contrib.auth.context_processors.auth',
    132129                'django.contrib.messages.context_processors.messages',
    133130            ],
    134131        },
  • tests/shortcuts/templates/shortcuts/render_test.html

    diff --git a/tests/shortcuts/templates/shortcuts/render_test.html b/tests/shortcuts/templates/shortcuts/render_test.html
    index 1b2f47a..c2bbd9a 100644
    a b  
    1 {{ foo }}.{{ bar }}.{{ baz }}.{{ STATIC_URL }}
     1{{ foo }}.{{ bar }}.{{ baz }}.{{ request.path }}
  • tests/shortcuts/tests.py

    diff --git a/tests/shortcuts/tests.py b/tests/shortcuts/tests.py
    index f5351df..e22cf4d 100644
    a b from django.test import TestCase, ignore_warnings, override_settings  
    33
    44
    55@override_settings(
    6     STATIC_URL='/path/to/static/media/',
    76    ROOT_URLCONF='shortcuts.urls',
    87)
    98class ShortcutTests(TestCase):
    class ShortcutTests(TestCase):  
    2322    def test_render_to_response_with_request_context(self):
    2423        response = self.client.get('/render_to_response/request_context/')
    2524        self.assertEqual(response.status_code, 200)
    26         self.assertEqual(response.content, b'FOO.BAR../path/to/static/media/\n')
     25        self.assertEqual(response.content, b'FOO.BAR../render_to_response/request_context/\n')
    2726        self.assertEqual(response['Content-Type'], 'text/html; charset=utf-8')
    2827
    2928    def test_render_to_response_with_content_type(self):
    class ShortcutTests(TestCase):  
    5251    def test_render(self):
    5352        response = self.client.get('/render/')
    5453        self.assertEqual(response.status_code, 200)
    55         self.assertEqual(response.content, b'FOO.BAR../path/to/static/media/\n')
     54        self.assertEqual(response.content, b'FOO.BAR../render/\n')
    5655        self.assertEqual(response['Content-Type'], 'text/html; charset=utf-8')
    5756        self.assertFalse(hasattr(response.context.request, 'current_app'))
    5857
    5958    def test_render_with_multiple_templates(self):
    6059        response = self.client.get('/render/multiple_templates/')
    6160        self.assertEqual(response.status_code, 200)
    62         self.assertEqual(response.content, b'FOO.BAR../path/to/static/media/\n')
     61        self.assertEqual(response.content, b'FOO.BAR../render/multiple_templates/\n')
    6362
    6463    @ignore_warnings(category=RemovedInDjango20Warning)
    6564    def test_render_with_base_context(self):
    class ShortcutTests(TestCase):  
    7170    def test_render_with_content_type(self):
    7271        response = self.client.get('/render/content_type/')
    7372        self.assertEqual(response.status_code, 200)
    74         self.assertEqual(response.content, b'FOO.BAR../path/to/static/media/\n')
     73        self.assertEqual(response.content, b'FOO.BAR../render/content_type/\n')
    7574        self.assertEqual(response['Content-Type'], 'application/x-rendertest')
    7675
    7776    def test_render_with_status(self):
    7877        response = self.client.get('/render/status/')
    7978        self.assertEqual(response.status_code, 403)
    80         self.assertEqual(response.content, b'FOO.BAR../path/to/static/media/\n')
     79        self.assertEqual(response.content, b'FOO.BAR../render/status/\n')
    8180
    8281    @ignore_warnings(category=RemovedInDjango20Warning)
    8382    def test_render_with_current_app(self):
  • tests/timezones/tests.py

    diff --git a/tests/timezones/tests.py b/tests/timezones/tests.py
    index 586e838..677d51a 100644
    a b from django.core import serializers  
    1616from django.core.urlresolvers import reverse
    1717from django.db.models import Min, Max
    1818from django.http import HttpRequest
    19 from django.template import Context, RequestContext, Template, TemplateSyntaxError
    20 from django.test import TestCase, override_settings, skipIfDBFeature, skipUnlessDBFeature
     19from django.template import (
     20    context_processors, Context, RequestContext, Template, TemplateSyntaxError)
     21from django.test import (
     22    TestCase, override_settings, skipIfDBFeature, skipUnlessDBFeature)
    2123from django.test.utils import requires_tz_support
    2224from django.utils import six
    2325from django.utils import timezone
    class TemplateTests(TestCase):  
    935937        Test the django.template.context_processors.tz template context processor.
    936938        """
    937939        tpl = Template("{{ TIME_ZONE }}")
    938         self.assertEqual(tpl.render(Context()), "")
    939         self.assertEqual(tpl.render(RequestContext(HttpRequest())), "Africa/Nairobi" if pytz else "EAT")
     940        context = Context()
     941        self.assertEqual(tpl.render(context), "")
     942        request_context = RequestContext(HttpRequest(), processors=[context_processors.tz])
     943        self.assertEqual(tpl.render(request_context), "Africa/Nairobi" if pytz else "EAT")
    940944
    941945    @requires_tz_support
    942946    def test_date_and_time_template_filters(self):
Back to Top