Log in as Manager::

    >>> browser.login(TEST_USER_NAME, TEST_USER_PASSWORD)

Create Shop::

    >>> browser.open('/++add++collective.cart.shopping.Shop')
    >>> browser.getControl(name="form.widgets.IDublinCore.title").value = 'Shöp'
    >>> browser.getControl(name="form.buttons.save").click()

Add Shipping Method::

    >>> browser.open('/shop/shipping-methods/createObject?type_name=ShippingMethod')
    >>> browser.getControl(name="title").value = 'ShippingMethöd1'
    >>> browser.getControl(name="description").value = 'Descriptiön of ShippingMethöd1'
    >>> browser.getControl(name="min_delivery_days").value = '3'
    >>> browser.getControl(name="max_delivery_days").value = '5'
    >>> browser.getControl(name="form.button.save").click()
    >>> 'Shipping fee for one kg' in browser.contents
    True
    >>> '1.0' in browser.contents
    True

Add ArticleContainer::

    >>> browser.open('/shop/++add++collective.cart.shopping.ArticleContainer')
    >>> browser.getControl(name="form.widgets.IDublinCore.title").value = 'Ärticle Container'
    >>> browser.getControl(name="form.buttons.save").click()

Add Article::

    >>> browser.open('/shop/article-container/article-container/++add++collective.cart.core.Article')
    >>> browser.getControl(name="form.widgets.IDublinCore.title").value = 'Ärticle1'
    >>> browser.getControl(name="form.widgets.IDublinCore.description").value = 'Description of Ärticle1'
    >>> browser.getControl(name="form.widgets.ISKU.sku").value = 'SKÖ1'
    >>> browser.getControl(name="form.widgets.IDiscount.price").value = '12.30'
    >>> browser.getControl(name="form.widgets.ISize.weight").value = '100'
    >>> browser.getControl(name="form.buttons.save").click()

    >>> article1_url = browser.url

Add Stock to Ärticle1::

    >>> browser.open('/shop/article-container/article1/++add++collective.cart.stock.Stock')
    >>> browser.getControl(name="form.widgets.IBasic.title").value = 'Stöck1'
    >>> browser.getControl(name="form.widgets.IBasic.description").value = 'Description of Stöck1'
    >>> browser.getControl(name="form.widgets.stock").value = '100'
    >>> browser.getControl( name="form.widgets.IStockPrice.price").value = '0.0'
    >>> browser.getControl(name="form.buttons.save").click()

    >>> stock1_url = browser.url

Add Ärticle1 to Cart::

    >>> browser.open(article1_url)
    >>> browser.getControl(name="form.buttons.AddToCart").click()

Go to Cart::

    >>> browser.open('/shop/@@cart')

Check Out::

    >>> browser.getControl(name="form.checkout").click()

Fill Billing Info::

    >>> browser.getControl(name="first_name").value = 'Billing First Näme'
    >>> browser.getControl(name="last_name").value = 'Billing Last Näme'
    >>> browser.getControl(name="organization").value = 'Billing Örganization'
    >>> browser.getControl(name="vat").value = 'Fı1234567890'
    >>> browser.getControl(name="email").value = 'first.last@email.bil'
    >>> browser.getControl(name="street").value = 'Billing Street Äddress'
    >>> browser.getControl(name="post").value = 'Billing Pöst Cöde'
    >>> browser.getControl(name="city").value = 'Billing €ity'
    >>> browser.getControl(name="phone").value = 'Billing Phöne Number'
    >>> browser.getControl(name="form.to.confirmation").click()

    >>> print browser.bycss('#cart-articles')
    --- 1 ---
    <section id="cart-articles"><table><tbody><tr><td class="image">
    <a href="http://nohost/plone/shop/article-container/article1" title="&#196;rticle1">
    <img src="http://nohost/plone/fallback.png"></a>
    </td>
    <td class="name">
    <h3>
    <a href="http://nohost/plone/shop/article-container/article1">&#196;rticle1</a>
    </h3>
    <p>Description of &#196;rticle1</p>
    </td>
    <td class="price-and-quantity">
    <span class="gross">12.30 &#8364;</span>
    <br><span class="vat">Including VAT: 23.00 %</span>
    </td>
    </tr></tbody></table></section>

    >>> print browser.bycss('#shipping-method')
    --- 1 ---
    <section id="shipping-method"><table><tbody><tr><td class="shipping-method-title">Shipping Method:</td>
    <td>ShippingMeth&#246;d1</td>
    <td class="price-and-quantity">
    <span class="gross">0.10 &#8364;</span>
    <br><span class="vat">Including VAT: 23.00 %</span>
    </td>
    </tr></tbody></table></section>

    >>> print browser.bycss('#confirmation-total')
    --- 1 ---
    <section id="confirmation-total"><span>Total</span>&#160;&#160;
    <span id="total">12.40 &#8364;</span>
    </section>

    >>> print browser.bycss('#confirmation-checkout')
    --- 1 ---
    <section id="confirmation-checkout"><form method="post" action="http://nohost/plone/shop/@@thanks">
    <button class="buttons shopping-button back" name="form.buttons.back" value="form.buttons.back" type="submit">Back</button>
    <button class="buttons shopping-button checkout" name="form.buttons.ConfirmOrder" value="form.buttons.ConfirmOrder" type="submit">Confirm Order</button>
    </form>
    </section>

Confirm the order::

    >>> len(mailhost.messages)
    0

    >>> browser.getControl(name="form.buttons.ConfirmOrder").click()

Check the newest message sent::

    >>> len(mailhost.messages)
    2

    >>> msg = mailhost.messages[-2]
    >>> prink(msg)
    MIME-Version: 1.0
    Content-Type: text/plain; charset="utf-8"
    Content-Transfer-Encoding: quoted-printable
    Subject: =?utf-8?q?Order_Number=3A_1?=
    To: =?utf-8?q?Billing_First_N=C3=A4me_Billing_Last_N=C3=A4me?=
     <first.last@email.bil>
    From: =?utf-8?q?Sh=C3=B6p?= <email@from.address>
    Date: ...
    <BLANKLINE>
    Thank you for the order.
    <BLANKLINE>
    Order Number: 1
    <BLANKLINE>
    Billing Address
    =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
    =3D=3D=3D
    Billing First N=C3=A4me Billing Last N=C3=A4me  Billing =C3=96rganization  =
    F=C4=B11234567890
    Billing Street =C3=84ddress
    Billing P=C3=B6st C=C3=B6de Billing =E2=82=ACity
    Billing Ph=C3=B6ne Number
    first.last@email.bil
    <BLANKLINE>
    Shipping Address
    =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
    =3D=3D=3D
    Billing First N=C3=A4me Billing Last N=C3=A4me  Billing =C3=96rganization  =
    F=C4=B11234567890
    Billing Street =C3=84ddress
    Billing P=C3=B6st C=C3=B6de Billing =E2=82=ACity
    Billing Ph=C3=B6ne Number
    first.last@email.bil
    <BLANKLINE>
    <BLANKLINE>
    Order Contents
    =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
    =3D=3D=3D
    SKU: SK=C3=961
    =C3=84rticle1 x 1 =3D 12.30 =E2=82=AC
    <BLANKLINE>
    Shipping Method: ShippingMeth=C3=B6d1 0.10 =E2=82=AC
    <BLANKLINE>
    Total: 12.40 =E2=82=AC
    <BLANKLINE>
    <BLANKLINE>
    Link to the order: http://nohost/plone/shop/cart-container/1
    <BLANKLINE>

    >>> msg = mailhost.messages[-1]
    >>> prink(msg)
    MIME-Version: 1.0
    Content-Type: text/plain; charset="utf-8"
    Content-Transfer-Encoding: quoted-printable
    Subject: =?utf-8?q?Order_Number=3A_1?=
    To: =?utf-8?q?Sh=C3=B6p?= <email@from.address>
    From: =?utf-8?q?Sh=C3=B6p?= <email@from.address>
    Date: ...
    <BLANKLINE>
    <BLANKLINE>
    <BLANKLINE>
    Order Number: 1
    Billing Address
    =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
    =3D=3D=3D
    Billing First N=C3=A4me Billing Last N=C3=A4me  Billing =C3=96rganization  =
    F=C4=B11234567890
    Billing Street =C3=84ddress
    Billing P=C3=B6st C=C3=B6de Billing =E2=82=ACity
    Billing Ph=C3=B6ne Number
    first.last@email.bil
    <BLANKLINE>
    Shipping Address
    =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
    =3D=3D=3D
    Billing First N=C3=A4me Billing Last N=C3=A4me  Billing =C3=96rganization  =
    F=C4=B11234567890
    Billing Street =C3=84ddress
    Billing P=C3=B6st C=C3=B6de Billing =E2=82=ACity
    Billing Ph=C3=B6ne Number
    first.last@email.bil
    <BLANKLINE>
    <BLANKLINE>
    <BLANKLINE>
    Order Contents
    =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
    =3D=3D=3D
    <BLANKLINE>
    SKU: SK=C3=961
    =C3=84rticle1 x 1 =3D 12.30 =E2=82=AC
    <BLANKLINE>
    <BLANKLINE>
    Shipping Method: ShippingMeth=C3=B6d1 0.10 =E2=82=AC
    <BLANKLINE>
    Total: 12.40 =E2=82=AC
    <BLANKLINE>
    <BLANKLINE>
    Link to the order: http://nohost/plone/shop/cart-container/1
    <BLANKLINE>

Add to-customer-order-mail-template-message:

    >>> browser.open('/shop/createObject?type_name=Folder')
    >>> browser.getControl(name="title").value = 'To Customer Order Mail Template Message'
    >>> browser.getControl(name="form.button.save").click()
    >>> browser.open('/shop/to-customer-order-mail-template-message/createObject?type_name=Document')
    >>> browser.getControl(name="title").value = 'English'
    >>> browser.getControl(name="description").value = 'Description öf English'
    >>> browser.getControl(name="text").value = '<p>Text öf English.</p>'
    >>> browser.getControl(name="form.button.save").click()

Add Ärticle1 to Cart::

    >>> browser.open(article1_url)
    >>> browser.getControl(name="form.buttons.AddToCart").click()

Go to Cart::

    >>> browser.open('/shop/@@cart')

Check Out::

    >>> browser.getControl(name="form.checkout").click()

Fill Billing Info with different info for shipping address::

    >>> browser.getControl(name="first_name").value = 'Billing First Näme'
    >>> browser.getControl(name="last_name").value = 'Billing Last Näme'
    >>> browser.getControl(name="organization").value = 'Billing Örganization'
    >>> browser.getControl(name="vat").value = 'Fı1234567890'
    >>> browser.getControl(name="email").value = 'first.last@email.bil'
    >>> browser.getControl(name="street").value = 'Billing Street Äddress'
    >>> browser.getControl(name="post").value = 'Billing Pöst Cöde'
    >>> browser.getControl(name="city").value = 'Billing €ity'
    >>> browser.getControl(name="phone").value = 'Billing Phöne Number'
    >>> browser.getControl(name="billing-and-shipping-same-or-different").value = ['different']
    >>> browser.getControl(name="form.to.confirmation").click()

Update Shipping Info::

    >>> browser.getControl(name="first_name").value = 'Shipping First Näme'
    >>> browser.getControl(name="last_name").value = 'Shipping Last Näme'
    >>> browser.getControl(name="organization").value = 'Shipping Örganization'
    >>> browser.getControl(name="vat").value = 'SHIPPING1234567890'
    >>> browser.getControl(name="email").value = 'first.last@email.shi'
    >>> browser.getControl(name="street").value = 'Shipping Street Äddress'
    >>> browser.getControl(name="post").value = 'Shipping Pöst Cöde'
    >>> browser.getControl(name="city").value = 'Shipping €ity'
    >>> browser.getControl(name="phone").value = 'Shipping Phöne Number'
    >>> browser.getControl(name="form.to.confirmation").click()

Confirm the order::

    >>> browser.getControl(name="form.buttons.ConfirmOrder").click()

Check the newest message sent::

    >>> len(mailhost.messages)
    4

    >>> msg = mailhost.messages[-2]
    >>> prink(msg)
    MIME-Version: 1.0
    Content-Type: text/plain; charset="utf-8"
    Content-Transfer-Encoding: quoted-printable
    Subject: =?utf-8?q?Order_Number=3A_2?=
    To: =?utf-8?q?Billing_First_N=C3=A4me_Billing_Last_N=C3=A4me?=
     <first.last@email.bil>
    From: =?utf-8?q?Sh=C3=B6p?= <email@from.address>
    Date: ...
    <BLANKLINE>
    Thank you for the order.
    Description =C3=B6f English
    <BLANKLINE>
    <BLANKLINE>
    Order Number: 2
    <BLANKLINE>
    <BLANKLINE>
    Billing Address
    =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
    =3D=3D=3D
    Billing First N=C3=A4me Billing Last N=C3=A4me  Billing =C3=96rganization  =
    F=C4=B11234567890
    Billing Street =C3=84ddress
    Billing P=C3=B6st C=C3=B6de Billing =E2=82=ACity
    Billing Ph=C3=B6ne Number
    first.last@email.bil
    <BLANKLINE>
    Shipping Address
    =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
    =3D=3D=3D
    Shipping First N=C3=A4me Shipping Last N=C3=A4me  Shipping =C3=96rganizatio=
    n  SHIPPING1234567890
    Shipping Street =C3=84ddress
    Shipping P=C3=B6st C=C3=B6de Shipping =E2=82=ACity
    Shipping Ph=C3=B6ne Number
    first.last@email.shi
    <BLANKLINE>
    <BLANKLINE>
    <BLANKLINE>
    Order Contents
    =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
    =3D=3D=3D
    <BLANKLINE>
    SKU: SK=C3=961
    =C3=84rticle1 x 1 =3D 12.30 =E2=82=AC
    <BLANKLINE>
    <BLANKLINE>
    Shipping Method: ShippingMeth=C3=B6d1 0.10 =E2=82=AC
    <BLANKLINE>
    Total: 12.40 =E2=82=AC
    <BLANKLINE>
    <BLANKLINE>
    Link to the order: http://nohost/plone/shop/cart-container/2
    <BLANKLINE>
    Text =C3=B6f English.

    >>> msg = mailhost.messages[-1]
    >>> prink(msg)
    MIME-Version: 1.0
    Content-Type: text/plain; charset="utf-8"
    Content-Transfer-Encoding: quoted-printable
    Subject: =?utf-8?q?Order_Number=3A_2?=
    To: =?utf-8?q?Sh=C3=B6p?= <email@from.address>
    From: =?utf-8?q?Sh=C3=B6p?= <email@from.address>
    Date: ...
    <BLANKLINE>
    <BLANKLINE>
    <BLANKLINE>
    <BLANKLINE>
    <BLANKLINE>
    Order Number: 2
    <BLANKLINE>
    <BLANKLINE>
    Billing Address
    =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
    =3D=3D=3D
    Billing First N=C3=A4me Billing Last N=C3=A4me  Billing =C3=96rganization  =
    F=C4=B11234567890
    Billing Street =C3=84ddress
    Billing P=C3=B6st C=C3=B6de Billing =E2=82=ACity
    Billing Ph=C3=B6ne Number
    first.last@email.bil
    <BLANKLINE>
    Shipping Address
    =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
    =3D=3D=3D
    Shipping First N=C3=A4me Shipping Last N=C3=A4me  Shipping =C3=96rganizatio=
    n  SHIPPING1234567890
    Shipping Street =C3=84ddress
    Shipping P=C3=B6st C=C3=B6de Shipping =E2=82=ACity
    Shipping Ph=C3=B6ne Number
    first.last@email.shi
    <BLANKLINE>
    <BLANKLINE>
    <BLANKLINE>
    Order Contents
    =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
    =3D=3D=3D
    <BLANKLINE>
    SKU: SK=C3=961
    =C3=84rticle1 x 1 =3D 12.30 =E2=82=AC
    <BLANKLINE>
    <BLANKLINE>
    Shipping Method: ShippingMeth=C3=B6d1 0.10 =E2=82=AC
    <BLANKLINE>
    Total: 12.40 =E2=82=AC
    <BLANKLINE>
    <BLANKLINE>
    Link to the order: http://nohost/plone/shop/cart-container/2
    <BLANKLINE>
    <BLANKLINE>
    <BLANKLINE>
