def test_dm_pricing_input_prefix_and_suffix(self, question): form = dm_pricing_input(question) self.assert_params( lambda params: params["prefix"]["text"] == "£", form )
def test_dm_pricing_input_with_price_field(self, price_question, snapshot): form = dm_pricing_input(price_question) assert "components" not in form assert form["macro_name"] assert form["label"] assert form["params"]["id"] == "input-cost" assert form == snapshot
def test_dm_pricing_input_is_page_heading_false(self, question): form = dm_pricing_input(question, is_page_heading=False) if "label" in form: assert "isPageHeading" not in form["label"] elif "fieldset" in form: assert "isPageHeading" not in form["fieldset"] else: raise ValueError("form should have label or fieldset")
def test_dm_pricing_input_with_multiple_fields(self, pricing_question, snapshot): with pytest.raises(NotImplementedError): dm_pricing_input(pricing_question)