Warning:
Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.
| File fix_and_test_case.diff,
1.6 KB
(added by xaka, 2 years ago) |
|
|
-
|
|
|
|
| 24 | 24 | view.engines = engines |
| 25 | 25 | assert 'templating engine is not yet loaded' in msg |
| 26 | 26 | |
| | 27 | def test_same_classes_names_in_same_module(): |
| | 28 | """Test for ticket #2443""" |
| | 29 | class TestWidget(widgets.Widget): |
| | 30 | template = """<img />""" |
| | 31 | w1 = TestWidget() |
| | 32 | |
| | 33 | class TestWidget(widgets.Widget): |
| | 34 | template = """<img />""" |
| | 35 | w2 = TestWidget() |
| | 36 | |
| | 37 | w1.render() # NoneType object is not callable was here before the fix |
| | 38 | w2.render() |
| | 39 | |
| | 40 | # if downed here then all is ok and we can use |
| | 41 | # same classes names for widgets in same module |
| | 42 | assert True |
| | 43 | |
| 27 | 44 | def test_label(): |
| 28 | 45 | """Tests simple labels""" |
| 29 | 46 | label = widgets.Label("foo") |
-
|
|
|
|
| 59 | 59 | dct["__init__"] = _decorate_widget_init(dct["__init__"]) |
| 60 | 60 | cls.__init__ = dct["__init__"] |
| 61 | 61 | super(MetaWidget, cls).__init__(name, bases, dct) |
| 62 | | modname = "%s.%s" % (cls.__module__, name) |
| 63 | 62 | if cls.template: |
| 64 | 63 | (cls.template_c, |
| 65 | | cls.template) = load_kid_template(cls.template, modname) |
| | 64 | cls.template) = load_kid_template(cls.template) |
| 66 | 65 | cls._locked = False |
| 67 | 66 | |
| 68 | 67 | ############################################################################# |
Download in other formats: