--- a/migration.py Tue Oct 13 12:33:26 2015 +0200
+++ b/migration.py Mon Sep 21 17:51:58 2015 +0200
@@ -456,6 +456,10 @@
def version_strictly_lower(a, b):
+ if a is None:
+ return True
+ if b is None:
+ return False
if a:
a = Version(a)
if b:
--- a/test/unittest_migration.py Tue Oct 13 12:33:26 2015 +0200
+++ b/test/unittest_migration.py Mon Sep 21 17:51:58 2015 +0200
@@ -22,7 +22,7 @@
from cubicweb.devtools import TestServerConfiguration
from cubicweb.cwconfig import CubicWebConfiguration
-from cubicweb.migration import MigrationHelper, filter_scripts
+from cubicweb.migration import MigrationHelper, filter_scripts, version_strictly_lower
from cubicweb.server.migractions import ServerMigrationHelper
@@ -89,6 +89,10 @@
((0, 1 ,0), TMIGRDIR+'0.1.0_repository.py')])
config.__class__.name = 'repository'
+ def test_version_strictly_lower(self):
+ self.assertTrue(version_strictly_lower(None, '1.0.0'))
+ self.assertFalse(version_strictly_lower('1.0.0', None))
+
from cubicweb.devtools import ApptestConfiguration, get_test_db_handler