(self, groups, restore_user)
return xFixture
<fixture id="user-groups" user_id="TXPLAKJDFLIKSDFLMSDLFKJ">
            <groups>
                <group id="IUOWERJLKSFDAMAJLK">
                    <name>Team Inferno</name>
                </group>
                <group id="OUPIZXCVHKAJSDFEWL">
                    <name>Team Disaster</name>
                    <group_data>
                        <data key="leader">colonel panic</data>
                        <data key="skills">hatin</data>
                    </group_data>
                </group>
            </groups>
        </fixture>
<fixture id="user-groups" user_id="TXPLAKJDFLIKSDFLMSDLFKJ">
            <groups>
                <group id="IUOWERJLKSFDAMAJLK">
                    <name>Team Inferno</name>
                </group>
                <group id="OUPIZXCVHKAJSDFEWL">
                    <name>Team Disaster</name>
                    <group_data>
                        <data key="leader">colonel panic</data>
                        <data key="skills">hatin</data>
                    </group_data>
                </group>
            </groups>
        </fixture>
<fixture id = user - groups user_id = TXPLAKJDFLIKSDFLMSDLFKJ > <groups > <group id = IUOWERJLKSFDAMAJLK > <name > Team Inferno< / name > < / group > <group id = OUPIZXCVHKAJSDFEWL > <name > Team Disaster< / name > <group_data > <data key = leader > colonel panic< / data > <data key = skills > hatin< / data > < / group_data > < / group > < / groups > < / fixture >
def group_fixture(self, groups, restore_user):
        """
        <fixture id="user-groups" user_id="TXPLAKJDFLIKSDFLMSDLFKJ">
            <groups>
                <group id="IUOWERJLKSFDAMAJLK">
                    <name>Team Inferno</name>
                </group>
                <group id="OUPIZXCVHKAJSDFEWL">
                    <name>Team Disaster</name>
                    <group_data>
                        <data key="leader">colonel panic</data>
                        <data key="skills">hatin</data>
                    </group_data>
                </group>
            </groups>
        </fixture>
        """
        xFixture = ElementTree.Element('fixture', {'id': self.id, 'user_id': restore_user.user_id})
        xGroups = ElementTree.SubElement(xFixture, 'groups')

        for group in groups:
            xGroup = ElementTree.SubElement(xGroups, 'group', {'id': group.get_id})
            xName = ElementTree.SubElement(xGroup, 'name')
            xName.text = group.name
            if group.metadata:
                xGroup.append(get_data_element('group_data', group.metadata))

        return xFixture
def group_fixture ( self , groups , restore_user ) : xFixture = ElementTree . Element ( 'fixture' , { 'id' : self . id , 'user_id' : restore_user . user_id } ) xGroups = ElementTree . SubElement ( xFixture , 'groups' ) for group in groups : xGroup = ElementTree . SubElement ( xGroups , 'group' , { 'id' : group . get_id } ) xName = ElementTree . SubElement ( xGroup , 'name' ) xName . text = group . name if group . metadata : xGroup . append ( get_data_element ( 'group_data' , group . metadata ) ) return xFixture