예제 #1
0
class MDCheckBoxHasClassTest(TestCase):
    """MDCheckBox test in the case that the widget has a value."""
    def setUp(self):
        """Setup."""
        self.label = "This is a test"
        self.widget = MDCheckBox(self.label)

    def test_render(self):
        """Test render invokation."""
        result = self.widget.render("result", "UWAAAAAHHH")
        data = ("<md-checkbox data-name=\"result\" data-value=\"UWAAAAAHHH\" "
                "data-checked> {} </md-checkbox>").format(self.label)
        self.assertEqual(htmlmin.minify(result), htmlmin.minify(data))
예제 #2
0
class SimpleMDCheckBoxTest(TestCase):
    """Simple MDCheckBox Test."""
    def setUp(self):
        """Setup."""
        self.label = "This is a test"
        self.widget = MDCheckBox(self.label)

    def test_render(self):
        """Test render invokation."""
        result = self.widget.render("result", None)
        data = ("<md-checkbox data-name=\"result\"> {} </md-checkbox>").format(
            self.label)
        self.assertEqual(htmlmin.minify(result), htmlmin.minify(data))
예제 #3
0
class MDCheckBoxHasHelpTextTest(TestCase):
    """MDCheckBox test in the case that the widget has a help text."""
    def setUp(self):
        """Setup."""
        self.label = "This is a test"
        self.help_text = "This is a help text."
        self.widget = MDCheckBox(self.label, help_text=self.help_text)

    def test_render(self):
        """Test render invokation."""
        result = self.widget.render("result", None)
        data = ("<md-checkbox data-name=\"result\">"
                " %s <md-tooltip>%s</md-tooltip> "
                "</md-checkbox>") % (self.label, self.help_text)
        self.assertEqual(htmlmin.minify(result), htmlmin.minify(data))
예제 #4
0
 def setUp(self):
     """Setup."""
     self.label = "This is a test"
     self.help_text = "This is a help text."
     self.widget = MDCheckBox(self.label, help_text=self.help_text)
예제 #5
0
 def setUp(self):
     """Setup."""
     self.label = "This is a test"
     self.widget = MDCheckBox(self.label)