Ejemplo n.º 1
0
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)
Ejemplo n.º 2
0
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
Ejemplo n.º 3
0
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'
Ejemplo n.º 4
0
def test_contact_group_repr_and_str_no_identifier_has_name():
    cg = ContactGroup(name='world')
    assert repr(cg) == '<ContactGroup:None>'
    assert str(cg) == 'world'
Ejemplo n.º 5
0
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"'
Ejemplo n.º 6
0
def test_contact_group_repr_and_str_no_identifier_no_name():
    cg = ContactGroup()
    assert repr(cg) == '<ContactGroup:None>'
    assert str(cg) == 'contact group'