Skip to content

Commit

Permalink
Fix failing unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jan 5, 2018
1 parent 51a7efb commit ce161e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/core/layout/qgsreportsectionfieldgroup.cpp
Expand Up @@ -125,7 +125,7 @@ QgsLayout *QgsReportSectionFieldGroup::nextBody( bool &ok )

updateChildContexts( f );

ok = mBodyEnabled;
ok = true;
if ( mBody && mBodyEnabled )
{
mBody->reportContext().blockSignals( true );
Expand Down
7 changes: 5 additions & 2 deletions tests/src/python/test_qgsreport.py
Expand Up @@ -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())
Expand Down Expand Up @@ -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())
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit ce161e0

Please sign in to comment.