import pytest
from pytest import mark, raises
from bottle import template

@mark.parametrize('expected, params', [
    ("""<div class="pure-u-1-3 pure-u-lg-1-6">
  <div class="pure-g">
    <div class="pure-u-1">
      <div class="l-box">
        <h3>Item</h3>
      </div>
    </div>
<div class="pure-u-1">

<select id="item-include" name="item" size="10" multiple="true" style="width: calc(100% - 1em); margin: 0 1em 1em">
  <option value="Include" disabled="true" >Include</option>

  <option value="val1-to-backend"  >val1</option>
  <option value="val2" disabled="true" >val2</option>
</select>
</div>
<div class="pure-u-1">

<select id="item-exclude" name="item" size="10" multiple="true" style="width: calc(100% - 1em); margin: 0 1em 1em">
  <option value="Exclude" disabled="true" >Exclude</option>

  <option value="val1-to-backend"  >val1</option>
  <option value="val2" disabled="true" >val2</option>
</select>
</div>
  </div>
</div>""",{
    "name": "item",
    "_include": {
        "options": [{
            "value": "val1-to-backend",
            "display": "val1",
        },
        {
            "value": "val2",
            "disabled": True,
        },]
    },
    "_exclude": {
        "options": [{
            "value": "val1-to-backend",
            "display": "val1",
        },
        {
            "value": "val2",
            "disabled": True,
        },]
    } }),
])
def test_include_exclude_render_exact(expected, params):
    assert template('include-exclude', **params) == expected
