Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

Commit

Permalink
Fixed blocklist for severity only (bug 741841)
Browse files Browse the repository at this point in the history
  • Loading branch information
robhudson authored and cvan committed Apr 4, 2012
1 parent 391bb97 commit 23a0b43
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/blocklist/templates/blocklist/blocklist.xml
Expand Up @@ -41,6 +41,8 @@
</versionRange>
{% elif apiver > 2 and plugin.min and plugin.max %}
<versionRange {{ attrs(severity=plugin.severity, minVersion=plugin.min, maxVersion=plugin.max) }}></versionRange>
{% elif plugin.severity and not (plugin.min or plugin.max) %}
<versionRange {{ attrs(severity=plugin.severity) }}></versionRange>
{% endif %}
{% endif %}
</pluginItem>
Expand Down
10 changes: 10 additions & 0 deletions apps/blocklist/tests.py
Expand Up @@ -331,6 +331,16 @@ def test_plugin_with_target_app(self):
eq_(vr.getAttribute('minVersion'), '1')
eq_(vr.getAttribute('maxVersion'), '2')

def test_plugin_with_severity_only(self):
self.plugin.update(guid=None, severity=1)
vr = self.dom().getElementsByTagName('versionRange')[0]
eq_(vr.getAttribute('severity'), '1')
eq_(vr.getAttribute('minVersion'), '')
eq_(vr.getAttribute('maxVersion'), '')

eq_(vr.getElementsByTagName('targetApplication'), [],
'There should not be a <targetApplication> if there was no app')

def test_plugin_apiver_lt_3(self):
self.plugin.update(severity='2')
# No min & max so the app matches.
Expand Down

0 comments on commit 23a0b43

Please sign in to comment.