Ticket #15660: smart_if_broken_in.diff

File smart_if_broken_in.diff, 1.1 KB (added by donspaulding, 14 years ago)

smart-if-test-case

  • tests/regressiontests/templates/tests.py

     
    110110    def method(self):
    111111        return "OtherClass.method"
    112112
     113class ContainerInAClass:
     114    some_list = [SomeClass, OtherClass]
     115container_in_a_class_instance = ContainerInAClass()
     116
    113117class TestObj(object):
    114118    def is_true(self):
    115119        return True
     
    833837            # Contains
    834838            'if-tag-in-01': ("{% if 1 in x %}yes{% else %}no{% endif %}", {'x':[1]}, "yes"),
    835839            'if-tag-in-02': ("{% if 2 in x %}yes{% else %}no{% endif %}", {'x':[1]}, "no"),
     840            'if-tag-in-03': ("{% if a in b.some_list %}yes{% else %}no{% endif %}", {'a': SomeClass, 'b': container_in_a_class_instance}, "yes"),
    836841            'if-tag-not-in-01': ("{% if 1 not in x %}yes{% else %}no{% endif %}", {'x':[1]}, "no"),
    837842            'if-tag-not-in-02': ("{% if 2 not in x %}yes{% else %}no{% endif %}", {'x':[1]}, "yes"),
    838843
Back to Top