mirror of
https://github.com/SectorLabs/django-localized-fields.git
synced 2025-04-25 03:32:55 +03:00
Add test on render method
This commit is contained in:
parent
a38d53b609
commit
0f08eb8280
@ -1,3 +1,4 @@
|
||||
import re
|
||||
from django.conf import settings
|
||||
from django.test import TestCase
|
||||
|
||||
@ -42,3 +43,13 @@ class LocalizedFieldWidgetTestCase(TestCase):
|
||||
|
||||
for _, value in zip(settings.LANGUAGES, decompressed_values):
|
||||
assert not value
|
||||
|
||||
@staticmethod
|
||||
def test_render():
|
||||
"""Tests whether the :see:LocalizedFieldWidget correctly
|
||||
render."""
|
||||
|
||||
widget = LocalizedFieldWidget()
|
||||
output = widget.render(name='title', value=None)
|
||||
assert bool(re.search('<label (.|\n|\t)*>\w+<\/label>', output))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user