def test_shadow_form_session_matches_parent(self): # Confirm that shadow form session matches shadow parent session. # This confirms that the parent load actions are properly transfered to the shadow form suite = self.factory.app.create_suite() shadow_source_session = extract_xml_partial(suite, "./entry/command[@id='m0-f0']/../session") shadow_form_session = extract_xml_partial(suite, "./entry/command[@id='m0-f1']/../session") self.assertXMLEqual(shadow_source_session.decode('utf-8'), shadow_form_session.decode('utf-8'))
def test_index_location_fixtures(self): self.user._couch_user.set_location(self.locations['Massachusetts']) expected_result = self._assemble_expected_fixture( 'index_location_fixtures', ['Massachusetts', 'Suffolk', 'Boston', 'Revere', 'Middlesex', 'Cambridge', 'Somerville'], ) fixture_nodes = call_fixture_generator(flat_location_fixture_generator, self.user) self.assertEqual(len(fixture_nodes), 2) # fixture schema, then fixture # check the fixture like usual fixture = extract_xml_partial(ElementTree.tostring(fixture_nodes[1]), '.') expected_fixture = extract_xml_partial(expected_result, './fixture') self.assertXmlEqual(expected_fixture, fixture) # check the schema schema = extract_xml_partial(ElementTree.tostring(fixture_nodes[0]), '.') expected_schema = extract_xml_partial(expected_result, './schema') self.assertXmlEqual(expected_schema, schema)
def test_index_location_fixtures(self): self.user._couch_user.set_location(self.locations['Massachusetts']) expected_result = self._assemble_expected_fixture( 'index_location_fixtures', ['Massachusetts', 'Suffolk', 'Boston', 'Revere', 'Middlesex', 'Cambridge', 'Somerville'], ) fixture_nodes = call_fixture_generator(flat_location_fixture_generator, self.user) self.assertEqual(len(fixture_nodes), 2) # fixture schema, then fixture # check the fixture like usual fixture = extract_xml_partial(ElementTree.tostring(fixture_nodes[1]), '.') expected_fixture = extract_xml_partial(expected_result, './fixture') self.assertXmlEqual(expected_fixture, fixture) # check the schema schema = extract_xml_partial(ElementTree.tostring(fixture_nodes[0]), '.') expected_schema = extract_xml_partial(expected_result, './schema') self.assertXmlEqual(expected_schema, schema)