File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
tests/regressiontests/forms Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,9 @@ def __getitem__(self, name):
75
75
76
76
def add_js (self , data ):
77
77
if data :
78
- self ._js .extend ([path for path in data if path not in self ._js ])
78
+ for path in data :
79
+ if path not in self ._js :
80
+ self ._js .append (path )
79
81
80
82
def add_css (self , data ):
81
83
if data :
Original file line number Diff line number Diff line change 112
112
<script type="text/javascript" src="http://media.other.com/path/to/js2"></script>
113
113
<script type="text/javascript" src="https://secure.other.com/path/to/js3"></script>
114
114
115
+ # Regression check for #12879: specifying the same JS file multiple
116
+ # times in a single Media instance should result in that file only
117
+ # being included once.
118
+ >>> class MyWidget4(TextInput):
119
+ ... class Media:
120
+ ... js = ('/path/to/js1', '/path/to/js1')
121
+
122
+ >>> w4 = MyWidget4()
123
+ >>> print w4.media
124
+ <script type="text/javascript" src="/path/to/js1"></script>
125
+
126
+
115
127
###############################################################
116
128
# Property-based media definitions
117
129
###############################################################
You can’t perform that action at this time.
0 commit comments