mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #25547 -- Made Model.refresh_from_db() update FileField's instance.
This commit is contained in:
@@ -792,6 +792,11 @@ class FileFieldTests(unittest.TestCase):
|
||||
except OSError:
|
||||
self.fail("Deleting an unset FileField should not raise OSError.")
|
||||
|
||||
def test_refresh_from_db(self):
|
||||
d = Document.objects.create(myfile='something.txt')
|
||||
d.refresh_from_db()
|
||||
self.assertIs(d.myfile.instance, d)
|
||||
|
||||
|
||||
class BinaryFieldTests(test.TestCase):
|
||||
binary_data = b'\x00\x46\xFE'
|
||||
|
||||
Reference in New Issue
Block a user