web/test/unittest_formfields.py
branchstable
changeset 7879 9aae456abab5
parent 6781 5062d86d6ffe
child 8519 e436688f75f4
--- a/web/test/unittest_formfields.py	Tue Sep 27 16:04:30 2011 +0200
+++ b/web/test/unittest_formfields.py	Wed Sep 28 09:27:42 2011 +0200
@@ -144,6 +144,17 @@
         self.assertEqual(description_format_field.value(form), 'text/rest')
 
 
+    def test_property_key_field(self):
+        from cubicweb.web.views.cwproperties import PropertyKeyField
+        req = self.request()
+        field = PropertyKeyField()
+        e = self.vreg['etypes'].etype_class('CWProperty')(req)
+        renderer = self.vreg['formrenderers'].select('base', req)
+        form = EntityFieldsForm(req, entity=e)
+        form.formvalues = {}
+        field.render(form, renderer)
+
+
 class UtilsTC(TestCase):
     def test_vocab_sort(self):
         self.assertEqual(vocab_sort([('Z', 1), ('A', 2),