Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: c2e8d3effc
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 30 lines (26 sloc) 0.997 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
from webob import Request
from webob.multidict import NestedMultiDict
from tw2.core.testbase import assert_in_xml, assert_eq_xml, WidgetTest
from nose.tools import raises
from cStringIO import StringIO
from tw2.core import EmptyField, IntValidator, ValidationError
from cgi import FieldStorage
import formencode

import webob
if hasattr(webob, 'NestedMultiDict'):
    from webob import NestedMultiDict
else:
    from webob.multidict import NestedMultiDict

import tw2.jit.widgets as w

## TODO - this is a super-weak test. so much more is done after the fact to
## create the javascript calls.
class TestAreaChartWidget(WidgetTest):
    widget = w.AreaChart
    attrs = {'id' : 'foo'}
    params = {
        'data' : [
            { 'label': 'date A','values': [20, 40, 15, 5] },
            { 'label': 'date B', 'values': [30, 10, 45, 10] }
        ]
    }
    expected = """<div style="text-align:center; overflow:hidden; background-color:#3a3a3a; width: 500; height: 500;" id="foo"></div>"""
Something went wrong with that request. Please try again.