', html)
+ self.assertIn('
', html)
+ self.assertIn('
', html)
+ self.assertIn('', html)
+
class TestListBlock(unittest.TestCase):
def test_initialise_with_class(self):
@@ -261,7 +275,7 @@ class TestListBlock(unittest.TestCase):
html = self.render_form()
self.assertIn('', html)
- self.assertIn('', html)
+ self.assertIn('', html)
def test_render_form_values(self):
html = self.render_form()
@@ -271,6 +285,28 @@ class TestListBlock(unittest.TestCase):
self.assertIn('', html)
self.assertIn('', html)
+ def test_html_declarations(self):
+ class LinkBlock(blocks.StructBlock):
+ title = blocks.FieldBlock(forms.CharField())
+ link = blocks.FieldBlock(forms.URLField())
+
+ block = blocks.ListBlock(LinkBlock)
+ html = block.html_declarations()
+
+ self.assertIn('', html)
+ self.assertIn('', html)
+
+ def test_html_declarations_uses_default(self):
+ class LinkBlock(blocks.StructBlock):
+ title = blocks.FieldBlock(forms.CharField(), default="Github")
+ link = blocks.FieldBlock(forms.URLField(), default="http://www.github.com")
+
+ block = blocks.ListBlock(LinkBlock)
+ html = block.html_declarations()
+
+ self.assertIn('', html)
+ self.assertIn('', html)
+
class TestStreamBlock(unittest.TestCase):
def test_initialisation(self):
@@ -426,3 +462,25 @@ class TestStreamBlock(unittest.TestCase):
self.assertIn('', html)
self.assertIn('', html)
self.assertIn('', html)
+
+ def test_html_declarations(self):
+ class LinkBlock(blocks.StructBlock):
+ title = blocks.FieldBlock(forms.CharField())
+ link = blocks.FieldBlock(forms.URLField())
+
+ block = blocks.ListBlock(LinkBlock)
+ html = block.html_declarations()
+
+ self.assertIn('', html)
+ self.assertIn('', html)
+
+ def test_html_declarations_uses_default(self):
+ class LinkBlock(blocks.StructBlock):
+ title = blocks.FieldBlock(forms.CharField(), default="Github")
+ link = blocks.FieldBlock(forms.URLField(), default="http://www.github.com")
+
+ block = blocks.ListBlock(LinkBlock)
+ html = block.html_declarations()
+
+ self.assertIn('', html)
+ self.assertIn('', html)