Changes between Initial Version and Version 1 of Ticket #36191, comment 1


Ignore:
Timestamp:
Feb 15, 2025, 8:49:19 AM (7 days ago)
Author:
Jacob Walls

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #36191, comment 1

    initial v1  
    33{{{#!diff
    44diff --git a/tests/file_storage/tests.py b/tests/file_storage/tests.py
    5 index c048b8f071..b1dafd7cb9 100644
     5index c048b8f071..fcbf633bb4 100644
    66--- a/tests/file_storage/tests.py
    77+++ b/tests/file_storage/tests.py
    8 @@ -617,7 +617,8 @@ class OverwritingStorageTests(FileStorageTests):
     8@@ -616,8 +616,8 @@ class OverwritingStorageTests(FileStorageTests):
     9         """Saving to same file name twice overwrites the first file."""
    910         name = "test.file"
    1011         self.assertFalse(self.storage.exists(name))
    11          content_1 = b"content one"
     12-        content_1 = b"content one"
    1213-        content_2 = b"second content"
    13 +        content_2 = b"overwrite"
    14 +        assert len(content_1) > len(content_2), "Ensure truncation is tested."
     14+        content_1 = b"content one: this part should be truncated."
     15+        content_2 = b"content two"
    1516         f_1 = ContentFile(content_1)
    1617         f_2 = ContentFile(content_2)
     
    2627  File "/Users/.../django/tests/file_storage/tests.py", line 633, in test_save_overwrite_behavior
    2728    self.assertEqual(fp.read(), content_2)
    28 AssertionError: b'overwritene' != b'overwrite'
     29AssertionError: b'content two: this part should be truncated.' != b'content two'
    2930
    3031----------------------------------------------------------------------
Back to Top