Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add test for 0/NULL range widget
For #18297
  • Loading branch information
m-kuhn committed Mar 1, 2018
1 parent 0b49a83 commit b20889a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/src/python/test_qgsrangewidgets.py
Expand Up @@ -45,6 +45,7 @@ def __createRangeWidget(self, allownull=False):
reg = QgsGui.editorWidgetRegistry()
configWdg = reg.createConfigWidget('Range', self.layer, 1, None)
config = configWdg.config()
config["Min"] = 0

# if null shall be allowed
if allownull:
Expand Down Expand Up @@ -84,10 +85,13 @@ def test_range_widget_null_allowed(self):
rangewidget = self.__createRangeWidget(True)

rangewidget.setValue(NULL)
assert rangewidget.value() == NULL
self.assertEqual(rangewidget.value(), NULL)

rangewidget.setValue(None)
assert rangewidget.value() == NULL
self.assertEqual(rangewidget.value(), NULL)

rangewidget.setValue(0)
self.assertEqual(rangewidget.value(), 0)


if __name__ == '__main__':
Expand Down

0 comments on commit b20889a

Please sign in to comment.