From 11971cd87c6cb208325d28ddf7e663dadde77d68 Mon Sep 17 00:00:00 2001 From: Mykola Kokalko Date: Thu, 2 May 2019 10:34:10 +0200 Subject: [PATCH] Added tests for setting models.fields.FilePathField.path. --- tests/model_fields/test_filepathfield.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tests/model_fields/test_filepathfield.py diff --git a/tests/model_fields/test_filepathfield.py b/tests/model_fields/test_filepathfield.py new file mode 100644 index 00000000000..d5d43ff6f6d --- /dev/null +++ b/tests/model_fields/test_filepathfield.py @@ -0,0 +1,12 @@ +import os + +from django.db.models import FilePathField +from django.test import SimpleTestCase + + +class FilePathFieldTests(SimpleTestCase): + def test_path(self): + path = os.path.dirname(__file__) + field = FilePathField(path=path) + self.assertEqual(field.path, path) + self.assertEqual(field.formfield().path, path)