mirror of
https://github.com/django/django.git
synced 2025-01-03 06:55:47 +00:00
Fixed #21268 -- Fixed E303 pep8 warnings
This commit is contained in:
parent
65d1d65d52
commit
bab9123daa
@ -155,7 +155,6 @@ def result_headers(cl):
|
|||||||
if i not in ordering_field_columns:
|
if i not in ordering_field_columns:
|
||||||
o_list_primary.insert(0, make_qs_param(new_order_type, i))
|
o_list_primary.insert(0, make_qs_param(new_order_type, i))
|
||||||
|
|
||||||
|
|
||||||
yield {
|
yield {
|
||||||
"text": text,
|
"text": text,
|
||||||
"sortable": True,
|
"sortable": True,
|
||||||
|
@ -236,7 +236,6 @@ class CustomUserModelBackendAuthenticateTest(TestCase):
|
|||||||
self.assertEqual(test_user, authenticated_user)
|
self.assertEqual(test_user, authenticated_user)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class TestObj(object):
|
class TestObj(object):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -198,7 +198,6 @@ class PasswordResetTest(AuthViewsTestCase):
|
|||||||
self.assertEqual(len(mail.outbox), 0)
|
self.assertEqual(len(mail.outbox), 0)
|
||||||
self.assertEqual(len(logger_calls), 1)
|
self.assertEqual(len(logger_calls), 1)
|
||||||
|
|
||||||
|
|
||||||
def _test_confirm_start(self):
|
def _test_confirm_start(self):
|
||||||
# Start by creating the email
|
# Start by creating the email
|
||||||
self.client.post('/password_reset/', {'email': 'staffmember@example.com'})
|
self.client.post('/password_reset/', {'email': 'staffmember@example.com'})
|
||||||
|
@ -203,7 +203,6 @@ class ContentTypesTests(TestCase):
|
|||||||
DeferredProxyModel: proxy_model_ct,
|
DeferredProxyModel: proxy_model_ct,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
@override_settings(ALLOWED_HOSTS=['example.com'])
|
@override_settings(ALLOWED_HOSTS=['example.com'])
|
||||||
def test_shortcut_view(self):
|
def test_shortcut_view(self):
|
||||||
"""
|
"""
|
||||||
|
@ -101,7 +101,6 @@ class FormPreview(object):
|
|||||||
"Context for template rendering."
|
"Context for template rendering."
|
||||||
return {'form': form, 'stage_field': self.unused_name('stage'), 'state': self.state}
|
return {'form': form, 'stage_field': self.unused_name('stage'), 'state': self.state}
|
||||||
|
|
||||||
|
|
||||||
def parse_params(self, *args, **kwargs):
|
def parse_params(self, *args, **kwargs):
|
||||||
"""
|
"""
|
||||||
Given captured args and kwargs from the URLconf, saves something in
|
Given captured args and kwargs from the URLconf, saves something in
|
||||||
|
@ -139,7 +139,6 @@ class PreviewTests(TestCase):
|
|||||||
response = self.client.post('/preview/', self.test_data)
|
response = self.client.post('/preview/', self.test_data)
|
||||||
self.assertEqual(response.content, success_string_encoded)
|
self.assertEqual(response.content, success_string_encoded)
|
||||||
|
|
||||||
|
|
||||||
def test_form_submit_bad_hash(self):
|
def test_form_submit_bad_hash(self):
|
||||||
"""
|
"""
|
||||||
Test contrib.formtools.preview form submittal does not proceed
|
Test contrib.formtools.preview form submittal does not proceed
|
||||||
|
@ -145,7 +145,6 @@ class ListMixinTest(unittest.TestCase):
|
|||||||
pl[::k] = ssl
|
pl[::k] = ssl
|
||||||
self.assertEqual(pl, ul[:], 'set slice [::%d]' % (k))
|
self.assertEqual(pl, ul[:], 'set slice [::%d]' % (k))
|
||||||
|
|
||||||
|
|
||||||
def test03_delslice(self):
|
def test03_delslice(self):
|
||||||
'Delete slice'
|
'Delete slice'
|
||||||
for Len in range(self.limit):
|
for Len in range(self.limit):
|
||||||
|
@ -32,7 +32,6 @@ class DistanceTest(unittest.TestCase):
|
|||||||
self.assertEqual(d.m, 1.0)
|
self.assertEqual(d.m, 1.0)
|
||||||
self.assertEqual(d.mm, 1000.0)
|
self.assertEqual(d.mm, 1000.0)
|
||||||
|
|
||||||
|
|
||||||
def testInitInvalid(self):
|
def testInitInvalid(self):
|
||||||
"Testing initialisation from invalid units"
|
"Testing initialisation from invalid units"
|
||||||
self.assertRaises(AttributeError, D, banana=100)
|
self.assertRaises(AttributeError, D, banana=100)
|
||||||
|
@ -284,7 +284,6 @@ class SessionTestsMixin(object):
|
|||||||
self.assertEqual(len(calls), 1)
|
self.assertEqual(len(calls), 1)
|
||||||
self.assertTrue('corrupted' in calls[0])
|
self.assertTrue('corrupted' in calls[0])
|
||||||
|
|
||||||
|
|
||||||
def test_actual_expiry(self):
|
def test_actual_expiry(self):
|
||||||
# this doesn't work with JSONSerializer (serializing timedelta)
|
# this doesn't work with JSONSerializer (serializing timedelta)
|
||||||
with override_settings(SESSION_SERIALIZER='django.contrib.sessions.serializers.PickleSerializer'):
|
with override_settings(SESSION_SERIALIZER='django.contrib.sessions.serializers.PickleSerializer'):
|
||||||
|
@ -42,7 +42,6 @@ class HTTPSitemapTests(SitemapTestsBase):
|
|||||||
""" % self.base_url
|
""" % self.base_url
|
||||||
self.assertXMLEqual(response.content.decode('utf-8'), expected_content)
|
self.assertXMLEqual(response.content.decode('utf-8'), expected_content)
|
||||||
|
|
||||||
|
|
||||||
def test_simple_sitemap_section(self):
|
def test_simple_sitemap_section(self):
|
||||||
"A simple sitemap section can be rendered"
|
"A simple sitemap section can be rendered"
|
||||||
response = self.client.get('/simple/sitemap-simple.xml')
|
response = self.client.get('/simple/sitemap-simple.xml')
|
||||||
|
@ -30,7 +30,6 @@ class BaseHandler(object):
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
self._request_middleware = self._view_middleware = self._template_response_middleware = self._response_middleware = self._exception_middleware = None
|
self._request_middleware = self._view_middleware = self._template_response_middleware = self._response_middleware = self._exception_middleware = None
|
||||||
|
|
||||||
|
|
||||||
def load_middleware(self):
|
def load_middleware(self):
|
||||||
"""
|
"""
|
||||||
Populate middleware lists from settings.MIDDLEWARE_CLASSES.
|
Populate middleware lists from settings.MIDDLEWARE_CLASSES.
|
||||||
|
@ -156,7 +156,6 @@ class LocaleRegexProvider(object):
|
|||||||
self._regex = regex
|
self._regex = regex
|
||||||
self._regex_dict = {}
|
self._regex_dict = {}
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def regex(self):
|
def regex(self):
|
||||||
"""
|
"""
|
||||||
|
@ -840,7 +840,6 @@ class BaseInlineFormSet(BaseModelFormSet):
|
|||||||
return 0
|
return 0
|
||||||
return super(BaseInlineFormSet, self).initial_form_count()
|
return super(BaseInlineFormSet, self).initial_form_count()
|
||||||
|
|
||||||
|
|
||||||
def _construct_form(self, i, **kwargs):
|
def _construct_form(self, i, **kwargs):
|
||||||
form = super(BaseInlineFormSet, self)._construct_form(i, **kwargs)
|
form = super(BaseInlineFormSet, self)._construct_form(i, **kwargs)
|
||||||
if self.save_as_new:
|
if self.save_as_new:
|
||||||
|
@ -89,7 +89,6 @@ class DiscoverRunner(object):
|
|||||||
break
|
break
|
||||||
kwargs['top_level_dir'] = top_level
|
kwargs['top_level_dir'] = top_level
|
||||||
|
|
||||||
|
|
||||||
if not (tests and tests.countTestCases()):
|
if not (tests and tests.countTestCases()):
|
||||||
# if no tests found, it's probably a package; try discovery
|
# if no tests found, it's probably a package; try discovery
|
||||||
tests = self.test_loader.discover(start_dir=label, **kwargs)
|
tests = self.test_loader.discover(start_dir=label, **kwargs)
|
||||||
|
@ -130,7 +130,6 @@ class MovedAttribute(_LazyDescr):
|
|||||||
return getattr(module, self.attr)
|
return getattr(module, self.attr)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class _MovedItems(types.ModuleType):
|
class _MovedItems(types.ModuleType):
|
||||||
"""Lazy loading of moved objects"""
|
"""Lazy loading of moved objects"""
|
||||||
|
|
||||||
@ -198,7 +197,6 @@ del attr
|
|||||||
moves = sys.modules[__name__ + ".moves"] = _MovedItems(__name__ + ".moves")
|
moves = sys.modules[__name__ + ".moves"] = _MovedItems(__name__ + ".moves")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Module_six_moves_urllib_parse(types.ModuleType):
|
class Module_six_moves_urllib_parse(types.ModuleType):
|
||||||
"""Lazy loading of moved objects in six.moves.urllib_parse"""
|
"""Lazy loading of moved objects in six.moves.urllib_parse"""
|
||||||
|
|
||||||
@ -484,13 +482,11 @@ if PY3:
|
|||||||
import builtins
|
import builtins
|
||||||
exec_ = getattr(builtins, "exec")
|
exec_ = getattr(builtins, "exec")
|
||||||
|
|
||||||
|
|
||||||
def reraise(tp, value, tb=None):
|
def reraise(tp, value, tb=None):
|
||||||
if value.__traceback__ is not tb:
|
if value.__traceback__ is not tb:
|
||||||
raise value.with_traceback(tb)
|
raise value.with_traceback(tb)
|
||||||
raise value
|
raise value
|
||||||
|
|
||||||
|
|
||||||
print_ = getattr(builtins, "print")
|
print_ = getattr(builtins, "print")
|
||||||
del builtins
|
del builtins
|
||||||
|
|
||||||
@ -507,12 +503,10 @@ else:
|
|||||||
_locs_ = _globs_
|
_locs_ = _globs_
|
||||||
exec("""exec _code_ in _globs_, _locs_""")
|
exec("""exec _code_ in _globs_, _locs_""")
|
||||||
|
|
||||||
|
|
||||||
exec_("""def reraise(tp, value, tb=None):
|
exec_("""def reraise(tp, value, tb=None):
|
||||||
raise tp, value, tb
|
raise tp, value, tb
|
||||||
""")
|
""")
|
||||||
|
|
||||||
|
|
||||||
def print_(*args, **kwargs):
|
def print_(*args, **kwargs):
|
||||||
"""The new-style print function."""
|
"""The new-style print function."""
|
||||||
fp = kwargs.pop("file", sys.stdout)
|
fp = kwargs.pop("file", sys.stdout)
|
||||||
|
@ -4,7 +4,7 @@ install-script = scripts/rpm-install.sh
|
|||||||
|
|
||||||
[flake8]
|
[flake8]
|
||||||
exclude=./django/utils/dictconfig.py,./django/contrib/comments/*,./django/utils/unittest.py,./tests/comment_tests/*,./django/test/_doctest.py
|
exclude=./django/utils/dictconfig.py,./django/contrib/comments/*,./django/utils/unittest.py,./tests/comment_tests/*,./django/test/_doctest.py
|
||||||
ignore=E123,E124,E125,E126,E127,E128,E225,E226,E241,E251,E302,E501,E203,E221,E227,E231,E261,E301,E303,F401,F403,F841,W601
|
ignore=E123,E124,E125,E126,E127,E128,E225,E226,E241,E251,E302,E501,E203,E221,E227,E231,E261,E301,F401,F403,F841,W601
|
||||||
|
|
||||||
[metadata]
|
[metadata]
|
||||||
license-file = LICENSE
|
license-file = LICENSE
|
||||||
|
@ -73,7 +73,6 @@ class ChangeListTests(TestCase):
|
|||||||
ia.list_max_show_all, ia.list_editable, ia)
|
ia.list_max_show_all, ia.list_editable, ia)
|
||||||
self.assertEqual(cl.queryset.query.select_related, False)
|
self.assertEqual(cl.queryset.query.select_related, False)
|
||||||
|
|
||||||
|
|
||||||
def test_result_list_empty_changelist_value(self):
|
def test_result_list_empty_changelist_value(self):
|
||||||
"""
|
"""
|
||||||
Regression test for #14982: EMPTY_CHANGELIST_VALUE should be honored
|
Regression test for #14982: EMPTY_CHANGELIST_VALUE should be honored
|
||||||
|
@ -513,7 +513,6 @@ class TestInlinePermissions(TestCase):
|
|||||||
'value="%i" name="inner2_set-0-id" />' % self.inner2_id, html=True)
|
'value="%i" name="inner2_set-0-id" />' % self.inner2_id, html=True)
|
||||||
self.assertContains(response, 'id="id_inner2_set-0-DELETE"')
|
self.assertContains(response, 'id="id_inner2_set-0-DELETE"')
|
||||||
|
|
||||||
|
|
||||||
def test_inline_change_fk_all_perms(self):
|
def test_inline_change_fk_all_perms(self):
|
||||||
permission = Permission.objects.get(codename='add_inner2', content_type=self.inner_ct)
|
permission = Permission.objects.get(codename='add_inner2', content_type=self.inner_ct)
|
||||||
self.user.user_permissions.add(permission)
|
self.user.user_permissions.add(permission)
|
||||||
|
@ -5,6 +5,5 @@ class Command(NoArgsCommand):
|
|||||||
help = "Test No-args commands"
|
help = "Test No-args commands"
|
||||||
requires_model_validation = False
|
requires_model_validation = False
|
||||||
|
|
||||||
|
|
||||||
def handle_noargs(self, **options):
|
def handle_noargs(self, **options):
|
||||||
print('EXECUTE:NoArgsCommand options=%s' % sorted(options.items()))
|
print('EXECUTE:NoArgsCommand options=%s' % sorted(options.items()))
|
||||||
|
@ -131,7 +131,6 @@ class ValidationTestCase(TestCase):
|
|||||||
inlines = [TwoAlbumFKAndAnEInline]
|
inlines = [TwoAlbumFKAndAnEInline]
|
||||||
MyAdmin.validate(Album)
|
MyAdmin.validate(Album)
|
||||||
|
|
||||||
|
|
||||||
def test_inline_self_validation(self):
|
def test_inline_self_validation(self):
|
||||||
class TwoAlbumFKAndAnEInline(admin.TabularInline):
|
class TwoAlbumFKAndAnEInline(admin.TabularInline):
|
||||||
model = TwoAlbumFKAndAnE
|
model = TwoAlbumFKAndAnE
|
||||||
@ -296,7 +295,6 @@ class ValidationTestCase(TestCase):
|
|||||||
model = Song
|
model = Song
|
||||||
fields = '__all__'
|
fields = '__all__'
|
||||||
|
|
||||||
|
|
||||||
class FieldsOnFormOnlyAdmin(admin.ModelAdmin):
|
class FieldsOnFormOnlyAdmin(admin.ModelAdmin):
|
||||||
form = SongForm
|
form = SongForm
|
||||||
fields = ['extra_data', 'title']
|
fields = ['extra_data', 'title']
|
||||||
|
@ -860,7 +860,6 @@ class HorizontalVerticalFilterSeleniumFirefoxTests(AdminSeleniumWebDriverTestCas
|
|||||||
self.selenium.get(
|
self.selenium.get(
|
||||||
'%s%s' % (self.live_server_url, '/admin_widgets/school/%s/' % self.school.id))
|
'%s%s' % (self.live_server_url, '/admin_widgets/school/%s/' % self.school.id))
|
||||||
|
|
||||||
|
|
||||||
for field_name in ['students', 'alumni']:
|
for field_name in ['students', 'alumni']:
|
||||||
from_box = '#id_%s_from' % field_name
|
from_box = '#id_%s_from' % field_name
|
||||||
to_box = '#id_%s_to' % field_name
|
to_box = '#id_%s_to' % field_name
|
||||||
|
@ -96,29 +96,24 @@ class GetModelsTest(TestCase):
|
|||||||
from .not_installed import models
|
from .not_installed import models
|
||||||
self.not_installed_module = models
|
self.not_installed_module = models
|
||||||
|
|
||||||
|
|
||||||
def test_get_model_only_returns_installed_models(self):
|
def test_get_model_only_returns_installed_models(self):
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
get_model("not_installed", "NotInstalledModel"), None)
|
get_model("not_installed", "NotInstalledModel"), None)
|
||||||
|
|
||||||
|
|
||||||
def test_get_model_with_not_installed(self):
|
def test_get_model_with_not_installed(self):
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
get_model(
|
get_model(
|
||||||
"not_installed", "NotInstalledModel", only_installed=False),
|
"not_installed", "NotInstalledModel", only_installed=False),
|
||||||
self.not_installed_module.NotInstalledModel)
|
self.not_installed_module.NotInstalledModel)
|
||||||
|
|
||||||
|
|
||||||
def test_get_models_only_returns_installed_models(self):
|
def test_get_models_only_returns_installed_models(self):
|
||||||
self.assertFalse(
|
self.assertFalse(
|
||||||
"NotInstalledModel" in
|
"NotInstalledModel" in
|
||||||
[m.__name__ for m in get_models()])
|
[m.__name__ for m in get_models()])
|
||||||
|
|
||||||
|
|
||||||
def test_get_models_with_app_label_only_returns_installed_models(self):
|
def test_get_models_with_app_label_only_returns_installed_models(self):
|
||||||
self.assertEqual(get_models(self.not_installed_module), [])
|
self.assertEqual(get_models(self.not_installed_module), [])
|
||||||
|
|
||||||
|
|
||||||
def test_get_models_with_not_installed(self):
|
def test_get_models_with_not_installed(self):
|
||||||
self.assertTrue(
|
self.assertTrue(
|
||||||
"NotInstalledModel" in [
|
"NotInstalledModel" in [
|
||||||
|
2
tests/cache/tests.py
vendored
2
tests/cache/tests.py
vendored
@ -794,7 +794,6 @@ class BaseCacheTests(object):
|
|||||||
self.assertEqual(self.custom_key_cache.get('answer2'), 42)
|
self.assertEqual(self.custom_key_cache.get('answer2'), 42)
|
||||||
self.assertEqual(self.custom_key_cache2.get('answer2'), 42)
|
self.assertEqual(self.custom_key_cache2.get('answer2'), 42)
|
||||||
|
|
||||||
|
|
||||||
def test_cache_write_unpickable_object(self):
|
def test_cache_write_unpickable_object(self):
|
||||||
update_middleware = UpdateCacheMiddleware()
|
update_middleware = UpdateCacheMiddleware()
|
||||||
update_middleware.cache = self.cache
|
update_middleware.cache = self.cache
|
||||||
@ -1496,7 +1495,6 @@ class CacheI18nTest(TestCase):
|
|||||||
self.assertIn(sanitized_name, learn_cache_key(request, response),
|
self.assertIn(sanitized_name, learn_cache_key(request, response),
|
||||||
"Cache keys should include the time zone name when time zones are active")
|
"Cache keys should include the time zone name when time zones are active")
|
||||||
|
|
||||||
|
|
||||||
@override_settings(
|
@override_settings(
|
||||||
CACHE_MIDDLEWARE_KEY_PREFIX="test",
|
CACHE_MIDDLEWARE_KEY_PREFIX="test",
|
||||||
CACHE_MIDDLEWARE_SECONDS=60,
|
CACHE_MIDDLEWARE_SECONDS=60,
|
||||||
|
@ -68,7 +68,6 @@ class CustomManagerTests(TestCase):
|
|||||||
# manager
|
# manager
|
||||||
self.assertIsInstance(self.p2.books, PublishedBookManager)
|
self.assertIsInstance(self.p2.books, PublishedBookManager)
|
||||||
|
|
||||||
|
|
||||||
# The default manager, "objects", doesn't exist, because a custom one
|
# The default manager, "objects", doesn't exist, because a custom one
|
||||||
# was provided.
|
# was provided.
|
||||||
self.assertRaises(AttributeError, lambda: Book.objects)
|
self.assertRaises(AttributeError, lambda: Book.objects)
|
||||||
|
@ -82,7 +82,6 @@ class DefaultFiltersTests(TestCase):
|
|||||||
finally:
|
finally:
|
||||||
decimal_ctx.prec = old_prec
|
decimal_ctx.prec = old_prec
|
||||||
|
|
||||||
|
|
||||||
def test_floatformat_py2_fail(self):
|
def test_floatformat_py2_fail(self):
|
||||||
self.assertEqual(floatformat(1.00000000000000015, 16), '1.0000000000000002')
|
self.assertEqual(floatformat(1.00000000000000015, 16), '1.0000000000000002')
|
||||||
|
|
||||||
@ -92,7 +91,6 @@ class DefaultFiltersTests(TestCase):
|
|||||||
if six.PY2:
|
if six.PY2:
|
||||||
test_floatformat_py2_fail = unittest.expectedFailure(test_floatformat_py2_fail)
|
test_floatformat_py2_fail = unittest.expectedFailure(test_floatformat_py2_fail)
|
||||||
|
|
||||||
|
|
||||||
def test_addslashes(self):
|
def test_addslashes(self):
|
||||||
self.assertEqual(addslashes('"double quotes" and \'single quotes\''),
|
self.assertEqual(addslashes('"double quotes" and \'single quotes\''),
|
||||||
'\\"double quotes\\" and \\\'single quotes\\\'')
|
'\\"double quotes\\" and \\\'single quotes\\\'')
|
||||||
|
@ -178,7 +178,6 @@ class ProxyDeleteTest(TestCase):
|
|||||||
|
|
||||||
return test_image
|
return test_image
|
||||||
|
|
||||||
|
|
||||||
def test_delete_proxy(self):
|
def test_delete_proxy(self):
|
||||||
"""
|
"""
|
||||||
Deleting the *proxy* instance bubbles through to its non-proxy and
|
Deleting the *proxy* instance bubbles through to its non-proxy and
|
||||||
@ -197,7 +196,6 @@ class ProxyDeleteTest(TestCase):
|
|||||||
self.assertEqual(len(FooImage.objects.all()), 0)
|
self.assertEqual(len(FooImage.objects.all()), 0)
|
||||||
self.assertEqual(len(FooFile.objects.all()), 0)
|
self.assertEqual(len(FooFile.objects.all()), 0)
|
||||||
|
|
||||||
|
|
||||||
def test_delete_proxy_of_proxy(self):
|
def test_delete_proxy_of_proxy(self):
|
||||||
"""
|
"""
|
||||||
Deleting a proxy-of-proxy instance should bubble through to its proxy
|
Deleting a proxy-of-proxy instance should bubble through to its proxy
|
||||||
@ -224,7 +222,6 @@ class ProxyDeleteTest(TestCase):
|
|||||||
self.assertEqual(len(FooFile.objects.all()), 0)
|
self.assertEqual(len(FooFile.objects.all()), 0)
|
||||||
self.assertEqual(len(FooImage.objects.all()), 0)
|
self.assertEqual(len(FooImage.objects.all()), 0)
|
||||||
|
|
||||||
|
|
||||||
def test_delete_concrete_parent(self):
|
def test_delete_concrete_parent(self):
|
||||||
"""
|
"""
|
||||||
Deleting an instance of a concrete model should also delete objects
|
Deleting an instance of a concrete model should also delete objects
|
||||||
@ -244,7 +241,6 @@ class ProxyDeleteTest(TestCase):
|
|||||||
self.assertEqual(len(FooFile.objects.all()), 0)
|
self.assertEqual(len(FooFile.objects.all()), 0)
|
||||||
self.assertEqual(len(FooImage.objects.all()), 0)
|
self.assertEqual(len(FooImage.objects.all()), 0)
|
||||||
|
|
||||||
|
|
||||||
def test_delete_proxy_pair(self):
|
def test_delete_proxy_pair(self):
|
||||||
"""
|
"""
|
||||||
If a pair of proxy models are linked by an FK from one concrete parent
|
If a pair of proxy models are linked by an FK from one concrete parent
|
||||||
|
@ -128,7 +128,6 @@ class FileStorageTests(TestCase):
|
|||||||
with temp_storage.open('tests/file_obj') as f:
|
with temp_storage.open('tests/file_obj') as f:
|
||||||
self.assertEqual(f.read(), b'some content')
|
self.assertEqual(f.read(), b'some content')
|
||||||
|
|
||||||
|
|
||||||
def test_stringio(self):
|
def test_stringio(self):
|
||||||
# Test passing StringIO instance as content argument to save
|
# Test passing StringIO instance as content argument to save
|
||||||
output = StringIO()
|
output = StringIO()
|
||||||
|
@ -41,7 +41,6 @@ class TestNoInitialDataLoading(TransactionTestCase):
|
|||||||
)
|
)
|
||||||
self.assertQuerysetEqual(Book.objects.all(), [])
|
self.assertQuerysetEqual(Book.objects.all(), [])
|
||||||
|
|
||||||
|
|
||||||
def test_flush(self):
|
def test_flush(self):
|
||||||
# Test presence of fixture (flush called by TransactionTestCase)
|
# Test presence of fixture (flush called by TransactionTestCase)
|
||||||
self.assertQuerysetEqual(
|
self.assertQuerysetEqual(
|
||||||
|
@ -372,7 +372,6 @@ class TestFixtures(TestCase):
|
|||||||
self.maxDiff = 1024
|
self.maxDiff = 1024
|
||||||
self.assertEqual(data, animals_data)
|
self.assertEqual(data, animals_data)
|
||||||
|
|
||||||
|
|
||||||
def test_proxy_model_included(self):
|
def test_proxy_model_included(self):
|
||||||
"""
|
"""
|
||||||
Regression for #11428 - Proxy models aren't included when you dumpdata
|
Regression for #11428 - Proxy models aren't included when you dumpdata
|
||||||
|
@ -509,7 +509,6 @@ class FormsExtraTestCase(TestCase, AssertFormErrorsMixin):
|
|||||||
self.assertTrue(f._has_changed('some text,JP,2007-04-25 06:24:00',
|
self.assertTrue(f._has_changed('some text,JP,2007-04-25 06:24:00',
|
||||||
['some text', ['J','P'], ['2009-04-25','11:44:00']]))
|
['some text', ['J','P'], ['2009-04-25','11:44:00']]))
|
||||||
|
|
||||||
|
|
||||||
class ComplexFieldForm(Form):
|
class ComplexFieldForm(Form):
|
||||||
field1 = ComplexField(widget=w)
|
field1 = ComplexField(widget=w)
|
||||||
|
|
||||||
|
@ -69,7 +69,6 @@ class FieldsTests(SimpleTestCase):
|
|||||||
self.class_a_var = True
|
self.class_a_var = True
|
||||||
super(A, self).__init__()
|
super(A, self).__init__()
|
||||||
|
|
||||||
|
|
||||||
class ComplexField(Field, A):
|
class ComplexField(Field, A):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(ComplexField, self).__init__()
|
super(ComplexField, self).__init__()
|
||||||
@ -718,7 +717,6 @@ class FieldsTests(SimpleTestCase):
|
|||||||
# with here)
|
# with here)
|
||||||
self.assertTrue(f._has_changed('resume.txt', {'filename': 'resume.txt', 'content': 'My resume'}))
|
self.assertTrue(f._has_changed('resume.txt', {'filename': 'resume.txt', 'content': 'My resume'}))
|
||||||
|
|
||||||
|
|
||||||
# URLField ##################################################################
|
# URLField ##################################################################
|
||||||
|
|
||||||
def test_urlfield_1(self):
|
def test_urlfield_1(self):
|
||||||
@ -965,7 +963,6 @@ class FieldsTests(SimpleTestCase):
|
|||||||
self.assertEqual(None, f.clean('3'))
|
self.assertEqual(None, f.clean('3'))
|
||||||
self.assertEqual(None, f.clean('hello'))
|
self.assertEqual(None, f.clean('hello'))
|
||||||
|
|
||||||
|
|
||||||
def test_nullbooleanfield_2(self):
|
def test_nullbooleanfield_2(self):
|
||||||
# Make sure that the internal value is preserved if using HiddenInput (#7753)
|
# Make sure that the internal value is preserved if using HiddenInput (#7753)
|
||||||
class HiddenNullBooleanForm(Form):
|
class HiddenNullBooleanForm(Form):
|
||||||
@ -1218,7 +1215,6 @@ class FieldsTests(SimpleTestCase):
|
|||||||
self.assertEqual(exp[1], got[1])
|
self.assertEqual(exp[1], got[1])
|
||||||
self.assertTrue(got[0].endswith(exp[0]))
|
self.assertTrue(got[0].endswith(exp[0]))
|
||||||
|
|
||||||
|
|
||||||
# SplitDateTimeField ##########################################################
|
# SplitDateTimeField ##########################################################
|
||||||
|
|
||||||
def test_splitdatetimefield_1(self):
|
def test_splitdatetimefield_1(self):
|
||||||
|
@ -1810,7 +1810,6 @@ class FormsTestCase(TestCase):
|
|||||||
CharField(label='Name', max_length=10))
|
CharField(label='Name', max_length=10))
|
||||||
super(ChoicesField, self).__init__(fields=fields, *args, **kwargs)
|
super(ChoicesField, self).__init__(fields=fields, *args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
field = ChoicesField()
|
field = ChoicesField()
|
||||||
field2 = copy.deepcopy(field)
|
field2 = copy.deepcopy(field)
|
||||||
self.assertTrue(isinstance(field2, ChoicesField))
|
self.assertTrue(isinstance(field2, ChoicesField))
|
||||||
|
@ -1068,7 +1068,6 @@ class FormsFormsetTestCase(TestCase):
|
|||||||
formset = CheckFormSet(data, prefix='check')
|
formset = CheckFormSet(data, prefix='check')
|
||||||
self.assertTrue(formset.is_valid())
|
self.assertTrue(formset.is_valid())
|
||||||
|
|
||||||
|
|
||||||
def test_formset_total_error_count(self):
|
def test_formset_total_error_count(self):
|
||||||
"""A valid formset should have 0 total errors."""
|
"""A valid formset should have 0 total errors."""
|
||||||
data = [ # formset_data, expected error count
|
data = [ # formset_data, expected error count
|
||||||
@ -1164,7 +1163,6 @@ class TestIsBoundBehavior(TestCase):
|
|||||||
self.assertTrue(formset.forms[0].is_valid())
|
self.assertTrue(formset.forms[0].is_valid())
|
||||||
self.assertEqual([{}], formset.cleaned_data)
|
self.assertEqual([{}], formset.cleaned_data)
|
||||||
|
|
||||||
|
|
||||||
def test_form_errors_are_caught_by_formset(self):
|
def test_form_errors_are_caught_by_formset(self):
|
||||||
data = {
|
data = {
|
||||||
'form-TOTAL_FORMS': '2',
|
'form-TOTAL_FORMS': '2',
|
||||||
|
@ -151,7 +151,6 @@ class GenericRelationsTests(TestCase):
|
|||||||
"<Animal: Platypus>"
|
"<Animal: Platypus>"
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
def test_multiple_gfk(self):
|
def test_multiple_gfk(self):
|
||||||
# Simple tests for multiple GenericForeignKeys
|
# Simple tests for multiple GenericForeignKeys
|
||||||
# only uses one model, since the above tests should be sufficient.
|
# only uses one model, since the above tests should be sufficient.
|
||||||
|
@ -22,7 +22,6 @@ class ArchiveIndexViewTests(TestCase):
|
|||||||
fixtures = ['generic-views-test-data.json']
|
fixtures = ['generic-views-test-data.json']
|
||||||
urls = 'generic_views.urls'
|
urls = 'generic_views.urls'
|
||||||
|
|
||||||
|
|
||||||
def test_archive_view(self):
|
def test_archive_view(self):
|
||||||
res = self.client.get('/dates/books/')
|
res = self.client.get('/dates/books/')
|
||||||
self.assertEqual(res.status_code, 200)
|
self.assertEqual(res.status_code, 200)
|
||||||
|
@ -156,7 +156,6 @@ class CreateViewTests(TestCase):
|
|||||||
['name', 'slug'])
|
['name', 'slug'])
|
||||||
self.assertEqual(len(w), 0)
|
self.assertEqual(len(w), 0)
|
||||||
|
|
||||||
|
|
||||||
def test_create_view_without_explicit_fields(self):
|
def test_create_view_without_explicit_fields(self):
|
||||||
|
|
||||||
with warnings.catch_warnings(record=True) as w:
|
with warnings.catch_warnings(record=True) as w:
|
||||||
|
@ -59,7 +59,6 @@ class HttpUtilTests(TestCase):
|
|||||||
conditional_content_removal(req, res)
|
conditional_content_removal(req, res)
|
||||||
self.assertEqual(b''.join(res), b'')
|
self.assertEqual(b''.join(res), b'')
|
||||||
|
|
||||||
|
|
||||||
# Strip content for HEAD requests.
|
# Strip content for HEAD requests.
|
||||||
req.method = 'HEAD'
|
req.method = 'HEAD'
|
||||||
|
|
||||||
|
@ -262,7 +262,6 @@ class TranslationTests(TransRealMixin, TestCase):
|
|||||||
self.assertRaises(TemplateSyntaxError, Template, '{% load i18n %}{% blocktrans context %}{% endblocktrans %}')
|
self.assertRaises(TemplateSyntaxError, Template, '{% load i18n %}{% blocktrans context %}{% endblocktrans %}')
|
||||||
self.assertRaises(TemplateSyntaxError, Template, '{% load i18n %}{% blocktrans count number=2 context %}{{ number }} super result{% plural %}{{ number }} super results{% endblocktrans %}')
|
self.assertRaises(TemplateSyntaxError, Template, '{% load i18n %}{% blocktrans count number=2 context %}{{ number }} super result{% plural %}{{ number }} super results{% endblocktrans %}')
|
||||||
|
|
||||||
|
|
||||||
def test_string_concat(self):
|
def test_string_concat(self):
|
||||||
"""
|
"""
|
||||||
six.text_type(string_concat(...)) should not raise a TypeError - #4796
|
six.text_type(string_concat(...)) should not raise a TypeError - #4796
|
||||||
|
@ -66,8 +66,6 @@ class M2mThroughTests(TestCase):
|
|||||||
[]
|
[]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def test_forward_descriptors(self):
|
def test_forward_descriptors(self):
|
||||||
# Due to complications with adding via an intermediary model,
|
# Due to complications with adding via an intermediary model,
|
||||||
# the add method is not provided.
|
# the add method is not provided.
|
||||||
|
@ -130,7 +130,6 @@ class CommonMiddlewareTest(TestCase):
|
|||||||
self.assertEqual(r.url,
|
self.assertEqual(r.url,
|
||||||
'http://www.testserver/middleware/slash/')
|
'http://www.testserver/middleware/slash/')
|
||||||
|
|
||||||
|
|
||||||
# The following tests examine expected behavior given a custom urlconf that
|
# The following tests examine expected behavior given a custom urlconf that
|
||||||
# overrides the default one through the request object.
|
# overrides the default one through the request object.
|
||||||
|
|
||||||
|
@ -31,7 +31,6 @@ if test_images:
|
|||||||
model = ImageFile
|
model = ImageFile
|
||||||
fields = '__all__'
|
fields = '__all__'
|
||||||
|
|
||||||
|
|
||||||
class OptionalImageFileForm(forms.ModelForm):
|
class OptionalImageFileForm(forms.ModelForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = OptionalImageFile
|
model = OptionalImageFile
|
||||||
@ -62,7 +61,6 @@ class DerivedBookForm(forms.ModelForm):
|
|||||||
fields = '__all__'
|
fields = '__all__'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class ExplicitPKForm(forms.ModelForm):
|
class ExplicitPKForm(forms.ModelForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = ExplicitPK
|
model = ExplicitPK
|
||||||
@ -609,8 +607,6 @@ class ValidationTest(TestCase):
|
|||||||
assert form.is_valid()
|
assert form.is_valid()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# unique/unique_together validation
|
# unique/unique_together validation
|
||||||
class UniqueTest(TestCase):
|
class UniqueTest(TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
@ -92,7 +92,6 @@ class OverrideCleanTests(TestCase):
|
|||||||
self.assertEqual(form.instance.left, 1)
|
self.assertEqual(form.instance.left, 1)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class PartiallyLocalizedTripleForm(forms.ModelForm):
|
class PartiallyLocalizedTripleForm(forms.ModelForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Triple
|
model = Triple
|
||||||
|
@ -66,7 +66,6 @@ class QueryTestCase(TestCase):
|
|||||||
title="Dive into Python"
|
title="Dive into Python"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_other_creation(self):
|
def test_other_creation(self):
|
||||||
"Objects created on another database don't leak onto the default database"
|
"Objects created on another database don't leak onto the default database"
|
||||||
# Create a book on the second database
|
# Create a book on the second database
|
||||||
@ -201,7 +200,6 @@ class QueryTestCase(TestCase):
|
|||||||
self.assertEqual(list(Book.objects.using('other').filter(authors__name='John Smith').values_list('title', flat=True)),
|
self.assertEqual(list(Book.objects.using('other').filter(authors__name='John Smith').values_list('title', flat=True)),
|
||||||
[])
|
[])
|
||||||
|
|
||||||
|
|
||||||
dive.authors.add(john)
|
dive.authors.add(john)
|
||||||
self.assertEqual(list(Book.objects.using('other').filter(authors__name='Mark Pilgrim').values_list('title', flat=True)),
|
self.assertEqual(list(Book.objects.using('other').filter(authors__name='Mark Pilgrim').values_list('title', flat=True)),
|
||||||
['Dive into Python'])
|
['Dive into Python'])
|
||||||
@ -1027,7 +1025,6 @@ class RouterTestCase(TestCase):
|
|||||||
self.assertFalse(router.allow_migrate('default', User))
|
self.assertFalse(router.allow_migrate('default', User))
|
||||||
self.assertTrue(router.allow_migrate('default', Book))
|
self.assertTrue(router.allow_migrate('default', Book))
|
||||||
|
|
||||||
|
|
||||||
def test_database_routing(self):
|
def test_database_routing(self):
|
||||||
marty = Person.objects.using('default').create(name="Marty Alchin")
|
marty = Person.objects.using('default').create(name="Marty Alchin")
|
||||||
pro = Book.objects.using('default').create(title="Pro Django",
|
pro = Book.objects.using('default').create(title="Pro Django",
|
||||||
@ -1907,8 +1904,6 @@ class MigrateTestCase(TestCase):
|
|||||||
self.assertEqual(cts.count(), 0)
|
self.assertEqual(cts.count(), 0)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class RouterUsed(Exception):
|
class RouterUsed(Exception):
|
||||||
WRITE = 'write'
|
WRITE = 'write'
|
||||||
|
|
||||||
|
@ -29,7 +29,6 @@ class NestedForeignKeysTests(TestCase):
|
|||||||
self.director = Person.objects.create(name='Terry Gilliam / Terry Jones')
|
self.director = Person.objects.create(name='Terry Gilliam / Terry Jones')
|
||||||
self.movie = Movie.objects.create(title='Monty Python and the Holy Grail', director=self.director)
|
self.movie = Movie.objects.create(title='Monty Python and the Holy Grail', director=self.director)
|
||||||
|
|
||||||
|
|
||||||
# This test failed in #16715 because in some cases INNER JOIN was selected
|
# This test failed in #16715 because in some cases INNER JOIN was selected
|
||||||
# for the second foreign key relation instead of LEFT OUTER JOIN.
|
# for the second foreign key relation instead of LEFT OUTER JOIN.
|
||||||
def testInheritance(self):
|
def testInheritance(self):
|
||||||
@ -52,7 +51,6 @@ class NestedForeignKeysTests(TestCase):
|
|||||||
self.assertEqual(Event.objects.filter(screening__movie=self.movie).count(), 1)
|
self.assertEqual(Event.objects.filter(screening__movie=self.movie).count(), 1)
|
||||||
self.assertEqual(Event.objects.exclude(screening__movie=self.movie).count(), 1)
|
self.assertEqual(Event.objects.exclude(screening__movie=self.movie).count(), 1)
|
||||||
|
|
||||||
|
|
||||||
# These all work because the second foreign key in the chain has null=True.
|
# These all work because the second foreign key in the chain has null=True.
|
||||||
def testInheritanceNullFK(self):
|
def testInheritanceNullFK(self):
|
||||||
some_event = Event.objects.create()
|
some_event = Event.objects.create()
|
||||||
@ -100,7 +98,6 @@ class NestedForeignKeysTests(TestCase):
|
|||||||
self.assertEqual(Package.objects.filter(screening__movie=self.movie).count(), 1)
|
self.assertEqual(Package.objects.filter(screening__movie=self.movie).count(), 1)
|
||||||
self.assertEqual(Package.objects.exclude(screening__movie=self.movie).count(), 1)
|
self.assertEqual(Package.objects.exclude(screening__movie=self.movie).count(), 1)
|
||||||
|
|
||||||
|
|
||||||
# These all work because the second foreign key in the chain has null=True.
|
# These all work because the second foreign key in the chain has null=True.
|
||||||
def testExplicitForeignKeyNullFK(self):
|
def testExplicitForeignKeyNullFK(self):
|
||||||
package = PackageNullFK.objects.create()
|
package = PackageNullFK.objects.create()
|
||||||
@ -131,7 +128,6 @@ class DeeplyNestedForeignKeysTests(TestCase):
|
|||||||
self.director = Person.objects.create(name='Terry Gilliam / Terry Jones')
|
self.director = Person.objects.create(name='Terry Gilliam / Terry Jones')
|
||||||
self.movie = Movie.objects.create(title='Monty Python and the Holy Grail', director=self.director)
|
self.movie = Movie.objects.create(title='Monty Python and the Holy Grail', director=self.director)
|
||||||
|
|
||||||
|
|
||||||
def testInheritance(self):
|
def testInheritance(self):
|
||||||
some_event = Event.objects.create()
|
some_event = Event.objects.create()
|
||||||
screening = Screening.objects.create(movie=self.movie)
|
screening = Screening.objects.create(movie=self.movie)
|
||||||
@ -151,7 +147,6 @@ class DeeplyNestedForeignKeysTests(TestCase):
|
|||||||
self.assertEqual(Event.objects.filter(screening__movie__director=self.director).count(), 1)
|
self.assertEqual(Event.objects.filter(screening__movie__director=self.director).count(), 1)
|
||||||
self.assertEqual(Event.objects.exclude(screening__movie__director=self.director).count(), 1)
|
self.assertEqual(Event.objects.exclude(screening__movie__director=self.director).count(), 1)
|
||||||
|
|
||||||
|
|
||||||
def testExplicitForeignKey(self):
|
def testExplicitForeignKey(self):
|
||||||
package = Package.objects.create()
|
package = Package.objects.create()
|
||||||
screening = Screening.objects.create(movie=self.movie)
|
screening = Screening.objects.create(movie=self.movie)
|
||||||
|
@ -59,7 +59,6 @@ class OrLookupsTests(TestCase):
|
|||||||
attrgetter("headline")
|
attrgetter("headline")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_stages(self):
|
def test_stages(self):
|
||||||
# You can shorten this syntax with code like the following, which is
|
# You can shorten this syntax with code like the following, which is
|
||||||
# especially useful if building the query in stages:
|
# especially useful if building the query in stages:
|
||||||
|
@ -48,7 +48,6 @@ class PrefetchRelatedTests(TestCase):
|
|||||||
normal_lists = [list(b.authors.all()) for b in Book.objects.all()]
|
normal_lists = [list(b.authors.all()) for b in Book.objects.all()]
|
||||||
self.assertEqual(lists, normal_lists)
|
self.assertEqual(lists, normal_lists)
|
||||||
|
|
||||||
|
|
||||||
def test_m2m_reverse(self):
|
def test_m2m_reverse(self):
|
||||||
with self.assertNumQueries(2):
|
with self.assertNumQueries(2):
|
||||||
lists = [list(a.books.all()) for a in Author.objects.prefetch_related('books')]
|
lists = [list(a.books.all()) for a in Author.objects.prefetch_related('books')]
|
||||||
|
@ -1527,7 +1527,6 @@ class Queries5Tests(TestCase):
|
|||||||
['<Ranking: 1: a3>', '<Ranking: 2: a2>', '<Ranking: 3: a1>']
|
['<Ranking: 1: a3>', '<Ranking: 2: a2>', '<Ranking: 3: a1>']
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
# Ordering of extra() pieces is possible, too and you can mix extra
|
# Ordering of extra() pieces is possible, too and you can mix extra
|
||||||
# fields and model fields in the ordering.
|
# fields and model fields in the ordering.
|
||||||
self.assertQuerysetEqual(
|
self.assertQuerysetEqual(
|
||||||
|
@ -611,7 +611,6 @@ class HostValidationTests(SimpleTestCase):
|
|||||||
}
|
}
|
||||||
request.get_host()
|
request.get_host()
|
||||||
|
|
||||||
|
|
||||||
@override_settings(DEBUG=True, ALLOWED_HOSTS=[])
|
@override_settings(DEBUG=True, ALLOWED_HOSTS=[])
|
||||||
def test_host_validation_disabled_in_debug_mode(self):
|
def test_host_validation_disabled_in_debug_mode(self):
|
||||||
"""If ALLOWED_HOSTS is empty and DEBUG is True, all hosts pass."""
|
"""If ALLOWED_HOSTS is empty and DEBUG is True, all hosts pass."""
|
||||||
|
@ -45,7 +45,6 @@ class SelectRelatedRegressTests(TestCase):
|
|||||||
# twice each, plus connection once). Thus, 6 joins plus the FROM table.
|
# twice each, plus connection once). Thus, 6 joins plus the FROM table.
|
||||||
self.assertEqual(str(connections.query).count(" JOIN "), 6)
|
self.assertEqual(str(connections.query).count(" JOIN "), 6)
|
||||||
|
|
||||||
|
|
||||||
def test_regression_8106(self):
|
def test_regression_8106(self):
|
||||||
"""
|
"""
|
||||||
Regression test for bug #8106.
|
Regression test for bug #8106.
|
||||||
|
@ -146,7 +146,6 @@ class SimpleTemplateResponseTest(TestCase):
|
|||||||
self.assertEqual(response.content, b'First template\n')
|
self.assertEqual(response.content, b'First template\n')
|
||||||
self.assertEqual(post, ['post1','post2'])
|
self.assertEqual(post, ['post1','post2'])
|
||||||
|
|
||||||
|
|
||||||
def test_pickling(self):
|
def test_pickling(self):
|
||||||
# Create a template response. The context is
|
# Create a template response. The context is
|
||||||
# known to be unpickleable (e.g., a function).
|
# known to be unpickleable (e.g., a function).
|
||||||
|
@ -283,7 +283,6 @@ class TemplateLoaderTests(TestCase):
|
|||||||
loader.template_source_loaders = old_loaders
|
loader.template_source_loaders = old_loaders
|
||||||
settings.TEMPLATE_DEBUG = old_td
|
settings.TEMPLATE_DEBUG = old_td
|
||||||
|
|
||||||
|
|
||||||
def test_extends_include_missing_baseloader(self):
|
def test_extends_include_missing_baseloader(self):
|
||||||
"""
|
"""
|
||||||
Tests that the correct template is identified as not existing
|
Tests that the correct template is identified as not existing
|
||||||
@ -1821,9 +1820,9 @@ class TemplateTests(TransRealMixin, TestCase):
|
|||||||
'numpy-array-index02': ("{{ var.5 }}", {"var": numpy.array(["first item", "second item"])}, ("", "INVALID")),
|
'numpy-array-index02': ("{{ var.5 }}", {"var": numpy.array(["first item", "second item"])}, ("", "INVALID")),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
return tests
|
return tests
|
||||||
|
|
||||||
|
|
||||||
class TemplateTagLoading(unittest.TestCase):
|
class TemplateTagLoading(unittest.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
@ -490,7 +490,6 @@ class TransactionTests(IgnoreDeprecationWarningsMixin, TransactionTestCase):
|
|||||||
r = Reporter.objects.get()
|
r = Reporter.objects.get()
|
||||||
self.assertEqual(r.first_name, "Robert")
|
self.assertEqual(r.first_name, "Robert")
|
||||||
|
|
||||||
|
|
||||||
@skipUnlessDBFeature('supports_transactions')
|
@skipUnlessDBFeature('supports_transactions')
|
||||||
def test_manually_managed(self):
|
def test_manually_managed(self):
|
||||||
"""
|
"""
|
||||||
|
@ -67,7 +67,6 @@ class GetInternalWSGIApplicationTest(unittest.TestCase):
|
|||||||
|
|
||||||
self.assertTrue(app is application)
|
self.assertTrue(app is application)
|
||||||
|
|
||||||
|
|
||||||
@override_settings(WSGI_APPLICATION=None)
|
@override_settings(WSGI_APPLICATION=None)
|
||||||
def test_default(self):
|
def test_default(self):
|
||||||
"""
|
"""
|
||||||
@ -90,7 +89,6 @@ class GetInternalWSGIApplicationTest(unittest.TestCase):
|
|||||||
finally:
|
finally:
|
||||||
basehttp.get_wsgi_application = _orig_get_wsgi_app
|
basehttp.get_wsgi_application = _orig_get_wsgi_app
|
||||||
|
|
||||||
|
|
||||||
@override_settings(WSGI_APPLICATION="wsgi.noexist.app")
|
@override_settings(WSGI_APPLICATION="wsgi.noexist.app")
|
||||||
def test_bad_module(self):
|
def test_bad_module(self):
|
||||||
with six.assertRaisesRegex(self,
|
with six.assertRaisesRegex(self,
|
||||||
@ -99,7 +97,6 @@ class GetInternalWSGIApplicationTest(unittest.TestCase):
|
|||||||
|
|
||||||
get_internal_wsgi_application()
|
get_internal_wsgi_application()
|
||||||
|
|
||||||
|
|
||||||
@override_settings(WSGI_APPLICATION="wsgi.wsgi.noexist")
|
@override_settings(WSGI_APPLICATION="wsgi.wsgi.noexist")
|
||||||
def test_bad_name(self):
|
def test_bad_name(self):
|
||||||
with six.assertRaisesRegex(self,
|
with six.assertRaisesRegex(self,
|
||||||
|
Loading…
Reference in New Issue
Block a user