diff options
| author | Tom Scrace <tom@scrace.org> | 2016-11-09 05:31:43 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-11-09 05:40:08 -0500 |
| commit | e7dfb60353686e9dc62d340e96b017deaa248638 (patch) | |
| tree | 9b84f3e3e48db759cac577c3c9bee4a78ba89615 | |
| parent | 5549e89b847beb89e8c8b85b6fd6924028d991c3 (diff) | |
Tested the test client uploading of NamedTemporaryFile.
| -rw-r--r-- | tests/test_client/tests.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/test_client/tests.py b/tests/test_client/tests.py index 7e5795b022..8d28c0816d 100644 --- a/tests/test_client/tests.py +++ b/tests/test_client/tests.py @@ -721,6 +721,11 @@ class ClientTest(TestCase): response = self.client.post('/upload_view/', data={'temp_file': test_file}) self.assertEqual(response.content, b'temp_file') + def test_uploading_named_temp_file(self): + test_file = tempfile.NamedTemporaryFile() + response = self.client.post('/upload_view/', data={'named_temp_file': test_file}) + self.assertEqual(response.content, b'named_temp_file') + @override_settings( MIDDLEWARE=['django.middleware.csrf.CsrfViewMiddleware'], |
