def testAggregate(self):

        assertTrue = self.assertTrue
        assertEqual = self.assertEqual
        assertRaises = self.assertRaises

        # Create two aggregates
        values1 = [2, 4, 6, 12]
        ga1 = S3GroupAggregate("avg", "Example", values1)
        assertEqual(ga1.result, 6.0)

        values2 = [5, 3, 9, 8]
        ga2 = S3GroupAggregate("avg", "Example", values2)
        assertEqual(ga2.result, 6.25)

        # Combine the two aggregates
        ga = S3GroupAggregate.aggregate((ga1, ga2))
        assertEqual(ga.result, 6.125)
        for value in values1 + values2:
            assertTrue(value in ga.values)

        # Combine with method mismatch
        ga = S3GroupAggregate("min", "Example", values1)
        with assertRaises(TypeError):
            S3GroupAggregate((ga1, ga2, ga))

        # Combine with key mismatch
        ga = S3GroupAggregate("avg", "Other", values1)
        with assertRaises(TypeError):
            S3GroupAggregate((ga1, ga2, ga))

# =============================================================================
A non-hidden field named FORM_TYPE does not set the form type.
dataset/ETHPy150Open sahana/eden/modules/unit_tests/s3/s3grouped.py/S3GroupAggregateTests.testAggregate--crossover with--dataset/ETHPy150Open ralphm/wokkel/wokkel/test/test_data_form.py/FormTest.test_fromElementFormTypeNotHidden