Added tests for setting models.fields.FilePathField.path.

This commit is contained in:
Mykola Kokalko 2019-05-02 10:34:10 +02:00 committed by Mariusz Felisiak
parent bceadd2788
commit 11971cd87c
1 changed files with 12 additions and 0 deletions

View File

@ -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)