@@ -1337,6 +1337,10 @@ void TestQgsValueRelationWidgetWrapper::testWithJsonInSpatialite()
1337
1337
1338
1338
// FEATURE 4
1339
1339
w_favoriteauthors.setFeature ( vl_json->getFeature ( 4 ) );
1340
+ // Because allowNull is false we have an invalid variant here
1341
+ QCOMPARE ( w_favoriteauthors.value (), QVariant ( ) );
1342
+ cfg_favoriteauthors[ QStringLiteral ( " AllowNull" ) ] = true ;
1343
+ w_favoriteauthors.setConfig ( cfg_favoriteauthors );
1340
1344
// check if first feature checked correctly (NULL)
1341
1345
QCOMPARE ( w_favoriteauthors.value (), QVariant ( QVariantList () ) );
1342
1346
QCOMPARE ( w_favoriteauthors.mTableWidget ->item ( 0 , 0 )->checkState (), Qt::Unchecked );
@@ -1346,9 +1350,16 @@ void TestQgsValueRelationWidgetWrapper::testWithJsonInSpatialite()
1346
1350
QCOMPARE ( w_favoriteauthors.mTableWidget ->item ( 4 , 0 )->checkState (), Qt::Unchecked );
1347
1351
QCOMPARE ( w_favoriteauthors.mTableWidget ->item ( 5 , 0 )->checkState (), Qt::Unchecked );
1348
1352
QCOMPARE ( w_favoriteauthors.mTableWidget ->item ( 6 , 0 )->checkState (), Qt::Unchecked );
1353
+ cfg_favoriteauthors[ QStringLiteral ( " AllowNull" ) ] = false ;
1354
+ w_favoriteauthors.setConfig ( cfg_favoriteauthors );
1349
1355
1350
1356
// FEATURE 5
1351
1357
w_favoriteauthors.setFeature ( vl_json->getFeature ( 5 ) );
1358
+ // Because allowNull is false we have an invalid variant here
1359
+ QCOMPARE ( w_favoriteauthors.value (), QVariant ( ) );
1360
+
1361
+ cfg_favoriteauthors[ QStringLiteral ( " AllowNull" ) ] = true ;
1362
+ w_favoriteauthors.setConfig ( cfg_favoriteauthors );
1352
1363
// check if first feature checked correctly (blank)
1353
1364
QCOMPARE ( w_favoriteauthors.value (), QVariant ( QVariantList ( ) ) );
1354
1365
QCOMPARE ( w_favoriteauthors.mTableWidget ->item ( 0 , 0 )->checkState (), Qt::Unchecked );
@@ -1495,6 +1506,11 @@ void TestQgsValueRelationWidgetWrapper::testWithJsonInSpatialiteTextFk()
1495
1506
// FEATURE 4
1496
1507
w_favoriteauthors.setFeature ( vl_json->getFeature ( 4 ) );
1497
1508
1509
+ // Because allowNull is false we have an invalid variant here
1510
+ QCOMPARE ( w_favoriteauthors.value (), QVariant ( ) );
1511
+ cfg_favoriteauthors[ QStringLiteral ( " AllowNull" ) ] = true ;
1512
+ w_favoriteauthors.setConfig ( cfg_favoriteauthors );
1513
+
1498
1514
// check if first feature checked correctly (NULL)
1499
1515
QCOMPARE ( w_favoriteauthors.value (), QVariant ( QVariantList ( ) ) );
1500
1516
@@ -1505,10 +1521,17 @@ void TestQgsValueRelationWidgetWrapper::testWithJsonInSpatialiteTextFk()
1505
1521
QCOMPARE ( w_favoriteauthors.mTableWidget ->item ( 4 , 0 )->checkState (), Qt::Unchecked );
1506
1522
QCOMPARE ( w_favoriteauthors.mTableWidget ->item ( 5 , 0 )->checkState (), Qt::Unchecked );
1507
1523
QCOMPARE ( w_favoriteauthors.mTableWidget ->item ( 6 , 0 )->checkState (), Qt::Unchecked );
1524
+ cfg_favoriteauthors[ QStringLiteral ( " AllowNull" ) ] = false ;
1525
+ w_favoriteauthors.setConfig ( cfg_favoriteauthors );
1508
1526
1509
1527
// FEATURE 5
1510
1528
w_favoriteauthors.setFeature ( vl_json->getFeature ( 5 ) );
1511
1529
1530
+ // Because allowNull is false we have an invalid variant here
1531
+ QCOMPARE ( w_favoriteauthors.value (), QVariant ( ) );
1532
+ cfg_favoriteauthors[ QStringLiteral ( " AllowNull" ) ] = true ;
1533
+ w_favoriteauthors.setConfig ( cfg_favoriteauthors );
1534
+
1512
1535
// check if first feature checked correctly (blank)
1513
1536
QCOMPARE ( w_favoriteauthors.value (), QVariant ( QVariantList () ) );
1514
1537
0 commit comments