# Path: tests/fixtures/build_fixture.py
# def build_fixture(modulename, data_variable_name='DATA'):
#     fixtures = deepcopy(
#         getattr(
#             importlib.import_module('..%s' % modulename, __name__),
#             data_variable_name,
#         )
#     )
# 
#     if 'submissions_xml' in fixtures:
#         # This fixture contains XML submissions, which apparently aren't used
#         # for anything yet; see
#         # `TestFormPackFixtures.test_xml_instances_loaded()`.
#         # Example XML fixture: tests/fixtures/favcolor/xml_instances.json
#         return fixtures
# 
#     title = fixtures.get('title')
# 
#     # separate the submissions from the schema
#     schemas = [dict(v) for v in fixtures['versions']]
#     submissions = []
#     for schema in schemas:
#         version = schema.get('version')
#         version_id_key = schema.get('version_id_key', '__version__')
#         for submission in schema.pop('submissions'):
#             submission.update({version_id_key: version})
#             submissions.append(submission)
#     return title, schemas, submissions


import json
import unittest
from formpack import FormPack
from .fixtures import build_fixture
                            },
                        ),
                        (
                            '2003-01-01',
                            {
                                'mean': 1.0,
                                'median': 1,
                                'mode': '*',
                                'stdev': '*',
                            },
                        ),
                        (
                            '2002-01-01',
                            {
                                'mean': 2.0,
                                'median': 2.0,
                                'mode': 2,
                                'stdev': 0.0,
                            },
                        ),
                    ),
                },
            ),
        ]

        for i, stat in enumerate(stats):
            assert stat == expected[i]

    def test_disaggregate_extended_fields(self):


# Path: tests/fixtures/build_fixture.py
# def build_fixture(modulename, data_variable_name='DATA'):
#     fixtures = deepcopy(
#         getattr(
#             importlib.import_module('..%s' % modulename, __name__),
#             data_variable_name,
#         )
#     )
# 
#     if 'submissions_xml' in fixtures:
#         # This fixture contains XML submissions, which apparently aren't used
#         # for anything yet; see
#         # `TestFormPackFixtures.test_xml_instances_loaded()`.
#         # Example XML fixture: tests/fixtures/favcolor/xml_instances.json
#         return fixtures
# 
#     title = fixtures.get('title')
# 
#     # separate the submissions from the schema
#     schemas = [dict(v) for v in fixtures['versions']]
#     submissions = []
#     for schema in schemas:
#         version = schema.get('version')
#         version_id_key = schema.get('version_id_key', '__version__')
#         for submission in schema.pop('submissions'):
#             submission.update({version_id_key: version})
#             submissions.append(submission)
#     return title, schemas, submissions


# Path: tests/test_autoreport.py
import json
import unittest
from formpack import FormPack
from .fixtures import build_fixture

                            },
                        ),
                        (
                            '2003-01-01',
                            {
                                'mean': 1.0,
                                'median': 1,
                                'mode': '*',
                                'stdev': '*',
                            },
                        ),
                        (
                            '2002-01-01',
                            {
                                'mean': 2.0,
                                'median': 2.0,
                                'mode': 2,
                                'stdev': 0.0,
                            },
                        ),
                    ),
                },
            ),
        ]

        for i, stat in enumerate(stats):
            assert stat == expected[i]

    def test_disaggregate_extended_fields(self):


        title, schemas, submissions = build_fixture(