-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from AccentDesign/bug_#3
Bug #3
- Loading branch information
Showing
12 changed files
with
145 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from wagtailstreamforms.blocks import InfoBlock | ||
|
||
from ..test_case import AppTestCase | ||
|
||
|
||
class TestInfoBlockTestCase(AppTestCase): | ||
|
||
def test_form_render_with_value(self): | ||
block = InfoBlock() | ||
|
||
test_form_html = block.render_form('foo') | ||
expected_html = '\n'.join([ | ||
'<div style="margin-top:5px;padding:0.9em 1.2em;">foo</div>' | ||
]) | ||
self.assertInHTML(expected_html, test_form_html) | ||
|
||
def test_form_render_no_value_with_help_text(self): | ||
block = InfoBlock(help_text='some help') | ||
|
||
test_form_html = block.render_form('') | ||
expected_html = '\n'.join([ | ||
'<div style="margin-top:5px;padding:0.9em 1.2em;">some help</div>' | ||
]) | ||
self.assertInHTML(expected_html, test_form_html) | ||
|
||
def test_form_render_value_and_help_text(self): | ||
block = InfoBlock(help_text='some help') | ||
|
||
test_form_html = block.render_form('foo') | ||
expected_html = '\n'.join([ | ||
'<div style="margin-top:5px;padding:0.9em 1.2em;">foo</div>' | ||
]) | ||
self.assertInHTML(expected_html, test_form_html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters