Skip to content
Permalink
Browse files

Add test for 0/NULL range widget

For #18297
  • Loading branch information
m-kuhn committed Mar 1, 2018
1 parent 0b49a83 commit b20889a6b998f95b72b6f47c80eebed0069a32b4
Showing with 6 additions and 2 deletions.
  1. +6 −2 tests/src/python/test_qgsrangewidgets.py
@@ -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:
@@ -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__':

0 comments on commit b20889a

Please sign in to comment.
You can’t perform that action at this time.