def test_contact_group_price_display_options_defined(taxes, hide_prices): options = ContactGroup( show_prices_including_taxes=taxes, hide_prices=hide_prices, ).get_price_display_options() assert isinstance(options, PriceDisplayOptions) assert options.include_taxes is taxes assert options.hide_prices is bool(hide_prices) assert options.show_prices is bool(not hide_prices)
def test_contact_group_price_display_options_defaults(): options = ContactGroup().get_price_display_options() assert isinstance(options, PriceDisplayOptions) assert options.include_taxes is None assert options.show_prices is True
def test_contact_group_repr_and_str_has_identifier_has_name(): cg = ContactGroup(identifier='hello', name='world') assert repr(cg) == '<ContactGroup:None-hello>' assert str(cg) == 'world'
def test_contact_group_repr_and_str_no_identifier_has_name(): cg = ContactGroup(name='world') assert repr(cg) == '<ContactGroup:None>' assert str(cg) == 'world'
def test_contact_group_repr_and_str_has_identifier_no_name(): cg = ContactGroup(identifier='hello') assert repr(cg) == '<ContactGroup:None-hello>' assert str(cg) == 'contact group "hello"'
def test_contact_group_repr_and_str_no_identifier_no_name(): cg = ContactGroup() assert repr(cg) == '<ContactGroup:None>' assert str(cg) == 'contact group'
def test_contact_group_repr_and_str_has_identifier_has_name(): cg = ContactGroup(identifier="hello", name="world") assert repr(cg) == "<ContactGroup:None-hello>" assert str(cg) == "world"