Removed unnecessary parentheses in various code.

This commit is contained in:
Jon Dufresne 2019-11-18 06:25:59 -08:00 committed by Mariusz Felisiak
parent 11e327a3ff
commit e649d691f8
4 changed files with 4 additions and 4 deletions

View File

@ -126,7 +126,7 @@ class ViewIndexView(BaseAdminDocsView):
'full_name': get_view_name(func), 'full_name': get_view_name(func),
'url': simplify_regex(regex), 'url': simplify_regex(regex),
'url_name': ':'.join((namespace or []) + (name and [name] or [])), 'url_name': ':'.join((namespace or []) + (name and [name] or [])),
'namespace': ':'.join((namespace or [])), 'namespace': ':'.join(namespace or []),
'name': name, 'name': name,
}) })
return super().get_context_data(**{**kwargs, 'views': views}) return super().get_context_data(**{**kwargs, 'views': views})

View File

@ -556,7 +556,7 @@ class Command(BaseCommand):
input_files = [bf.work_path for bf in build_files] input_files = [bf.work_path for bf in build_files]
with NamedTemporaryFile(mode='w+') as input_files_list: with NamedTemporaryFile(mode='w+') as input_files_list:
input_files_list.write(('\n'.join(input_files))) input_files_list.write('\n'.join(input_files))
input_files_list.flush() input_files_list.flush()
args.extend(['--files-from', input_files_list.name]) args.extend(['--files-from', input_files_list.name])
args.extend(self.xgettext_options) args.extend(self.xgettext_options)

View File

@ -657,7 +657,7 @@ class StateTests(SimpleTestCase):
return [mod for mod in state.apps.get_models() if mod._meta.model_name == 'a'][0] return [mod for mod in state.apps.get_models() if mod._meta.model_name == 'a'][0]
project_state = ProjectState() project_state = ProjectState()
project_state.add_model((ModelState.from_model(A))) project_state.add_model(ModelState.from_model(A))
self.assertEqual(len(get_model_a(project_state)._meta.related_objects), 1) self.assertEqual(len(get_model_a(project_state)._meta.related_objects), 1)
old_state = project_state.clone() old_state = project_state.clone()

View File

@ -3441,7 +3441,7 @@ class DisjunctionPromotionTests(TestCase):
self.assertEqual(str(qs.query).count('LEFT OUTER JOIN'), 3) self.assertEqual(str(qs.query).count('LEFT OUTER JOIN'), 3)
self.assertEqual(str(qs.query).count('INNER JOIN'), 0) self.assertEqual(str(qs.query).count('INNER JOIN'), 0)
qs = BaseA.objects.filter( qs = BaseA.objects.filter(
(Q(a__f1='foo') | (Q(a__f1='bar')) & (Q(b__f1='bar') | Q(c__f1='foo'))) Q(a__f1='foo') | Q(a__f1='bar') & (Q(b__f1='bar') | Q(c__f1='foo'))
) )
self.assertEqual(str(qs.query).count('LEFT OUTER JOIN'), 2) self.assertEqual(str(qs.query).count('LEFT OUTER JOIN'), 2)
self.assertEqual(str(qs.query).count('INNER JOIN'), 1) self.assertEqual(str(qs.query).count('INNER JOIN'), 1)