summaryrefslogtreecommitdiff
path: root/tests/fixtures
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2019-01-27 08:30:20 -0800
committerTim Graham <timograham@gmail.com>2019-01-27 17:41:43 -0500
commit7e3bf2662b5dedeb47856adc18a9378e2d10a599 (patch)
tree02f26e09739493958db05003060a48a0acfa885c /tests/fixtures
parentce7293bc91e993cd695d15e664126470c401eed6 (diff)
downloaddjango-7e3bf2662b5dedeb47856adc18a9378e2d10a599.tar.gz
Removed default mode='r' argument from calls to open().
Diffstat (limited to 'tests/fixtures')
-rw-r--r--tests/fixtures/tests.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/fixtures/tests.py b/tests/fixtures/tests.py
index 059b0ed80a..90dadac648 100644
--- a/tests/fixtures/tests.py
+++ b/tests/fixtures/tests.py
@@ -67,7 +67,7 @@ class DumpDataAssertMixin:
primary_keys=primary_keys,
)
if filename:
- with open(filename, "r") as f:
+ with open(filename) as f:
command_output = f.read()
os.remove(filename)
else:
@@ -699,7 +699,7 @@ class FixtureLoadingTests(DumpDataAssertMixin, TestCase):
fixture_json = os.path.join(tests_dir, 'fixtures', 'fixture1.json')
fixture_xml = os.path.join(tests_dir, 'fixtures', 'fixture3.xml')
- with mock.patch('django.core.management.commands.loaddata.sys.stdin', open(fixture_json, 'r')):
+ with mock.patch('django.core.management.commands.loaddata.sys.stdin', open(fixture_json)):
management.call_command('loaddata', '--format=json', '-', verbosity=0)
self.assertEqual(Article.objects.count(), 2)
self.assertQuerysetEqual(Article.objects.all(), [
@@ -707,7 +707,7 @@ class FixtureLoadingTests(DumpDataAssertMixin, TestCase):
'<Article: Poker has no place on ESPN>',
])
- with mock.patch('django.core.management.commands.loaddata.sys.stdin', open(fixture_xml, 'r')):
+ with mock.patch('django.core.management.commands.loaddata.sys.stdin', open(fixture_xml)):
management.call_command('loaddata', '--format=xml', '-', verbosity=0)
self.assertEqual(Article.objects.count(), 3)
self.assertQuerysetEqual(Article.objects.all(), [