Skip to content

Commit

Permalink
setting fkey values to null
Browse files Browse the repository at this point in the history
  • Loading branch information
signedav committed Jan 14, 2020
1 parent b0d9932 commit 883a527
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/src/gui/testqgsfeaturelistcombobox.cpp
Expand Up @@ -155,6 +155,29 @@ void TestQgsFeatureListComboBox::testMultipleForeignKeys()

cb->setIdentifierValues( QVariantList() << "gold" << 777 << "rush" );
QCOMPARE( cb->identifierValues(), QVariantList() << "gold" << 777 << "rush" );

cb->setIdentifierValues( QVariantList() );
QCOMPARE( cb->identifierValues().count(), 3 );
QCOMPARE( cb->identifierValues(), QVariantList() << QVariant() << QVariant() << QVariant() );

cb->setIdentifierValues( QVariantList() << "silver" << 888 << "fish" );
QCOMPARE( cb->identifierValues(), QVariantList() << "silver" << 888 << "fish" );

cb->setIdentifierValuesToNull();
QCOMPARE( cb->identifierValues().count(), 3 );
QCOMPARE( cb->identifierValues(), QVariantList() << QVariant() << QVariant() << QVariant() );

cb->setIdentifierFields( QStringList() << "material" << "raccord" );
cb->setDisplayExpression( "\"material\" || ' ' || \"raccord\"" );
cb->setAllowNull( true );

cb->setIdentifierValues( QVariantList() << "gold" << "fish" );
QCOMPARE( cb->identifierValues().count(), 2 );
QCOMPARE( cb->identifierValues(), QVariantList() << "gold" << "fish" );

cb->setIdentifierValues( QVariantList() );
QCOMPARE( cb->identifierValues().count(), 2 );
QCOMPARE( cb->identifierValues(), QVariantList() << QVariant() << QVariant() );
}

void TestQgsFeatureListComboBox::testAllowNull()
Expand Down

0 comments on commit 883a527

Please sign in to comment.