Skip to content
Permalink
Browse files

Fix failing unit test

  • Loading branch information
nyalldawson committed Jan 2, 2018
1 parent 51a7efb commit ce161e0e7d195cca00052ad71e189847d822cf6e
Showing with 6 additions and 3 deletions.
  1. +1 −1 src/core/layout/qgsreportsectionfieldgroup.cpp
  2. +5 −2 tests/src/python/test_qgsreport.py
@@ -125,7 +125,7 @@ QgsLayout *QgsReportSectionFieldGroup::nextBody( bool &ok )

updateChildContexts( f );

ok = mBodyEnabled;
ok = true;
if ( mBody && mBodyEnabled )
{
mBody->reportContext().blockSignals( true );
@@ -317,6 +317,7 @@ def testFieldGroup(self):
child1_body = QgsLayout(p)
child1.setLayer(ptLayer)
child1.setBody(child1_body)
child1.setBodyEnabled(True)
child1.setField('country')
r.appendChild(child1)
self.assertTrue(r.beginRender())
@@ -354,12 +355,13 @@ def testFieldGroup(self):

# another group
# remove body from child1
child1.setBody(None)
child1.setBodyEnabled(False)

child2 = QgsReportSectionFieldGroup()
child2_body = QgsLayout(p)
child2.setLayer(ptLayer)
child2.setBody(child2_body)
child2.setBodyEnabled(True)
child2.setField('state')
child1.appendChild(child2)
self.assertTrue(r.beginRender())
@@ -397,12 +399,13 @@ def testFieldGroup(self):

# another group
# remove body from child1
child2.setBody(None)
child2.setBodyEnabled(False)

child3 = QgsReportSectionFieldGroup()
child3_body = QgsLayout(p)
child3.setLayer(ptLayer)
child3.setBody(child3_body)
child3.setBodyEnabled(True)
child3.setField('town')
child3.setSortAscending(False)
child2.appendChild(child3)

0 comments on commit ce161e0

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