Beispiel #1
0
    def test_build(self):
        tested = MdsolDerivationDef(
            "AGE",
            variable_oid="VAROID",
            field_oid="FIELDOID",
            form_oid="MyForm",
            folder_oid="MyFolder",
            record_position=0,
            form_repeat_number=2,
            folder_repeat_number=3,
            logical_record_position="MaxBySubject",
            all_variables_in_fields=True,
            all_variables_in_folders=True,
        )
        doc = obj_to_doc(tested)
        tested << MdsolDerivationStep(function=StepType.Age)

        doc = obj_to_doc(tested)
        self.assertEqual("mdsol:DerivationDef", doc.tag)
        self.assertEqual("TRUE", doc.attrib["Active"])
        self.assertEqual("AGE", doc.attrib["OID"])
        self.assertEqual("FALSE", doc.attrib["NeedsRetesting"])
        self.assertEqual("FALSE", doc.attrib["BypassDuringMigration"])
        self.assertEqual("TRUE", doc.attrib["AllVariablesInFolders"])
        self.assertEqual("TRUE", doc.attrib["AllVariablesInFields"])
        self.assertEqual("VAROID", doc.attrib["VariableOID"])
        self.assertEqual("FIELDOID", doc.attrib["FieldOID"])
        self.assertEqual("MyForm", doc.attrib["FormOID"])
        self.assertEqual("MyFolder", doc.attrib["FolderOID"])
        self.assertEqual("0", doc.attrib["RecordPosition"])
        self.assertEqual("2", doc.attrib["FormRepeatNumber"])
        self.assertEqual("3", doc.attrib["FolderRepeatNumber"])
        self.assertEqual("MaxBySubject", doc.attrib["LogicalRecordPosition"])

        self.assertEqual("mdsol:DerivationStep", doc.getchildren()[0].tag)
Beispiel #2
0
 def test_builder(self):
     """XML produced"""
     tested = Decode()
     tested << TranslatedText("Yes")
     doc = obj_to_doc(tested)
     self.assertEqual("Decode", doc.tag)
     self.assertEqual("TranslatedText", doc.getchildren()[0].tag)
Beispiel #3
0
 def test_build(self):
     tested = MdsolCheckAction(
         field_oid="Field",
         variable_oid="TheVAR",
         form_oid="The Form",
         form_repeat_number=1,
         folder_oid="The Folder",
         folder_repeat_number=2,
         record_position=3,
         check_action_type=ActionType.SetDataPoint,
         check_string="CString",  # Knowing which of these to use for each action type is
         check_script="CScript",  # the trick. Best to look in an Architect Loader Spreadsheet
         check_options="COptions",
     )  # to get an idea
     doc = obj_to_doc(tested)
     self.assertEqual("mdsol:CheckAction", doc.tag)
     self.assertEqual("The Folder", doc.attrib["FolderOID"])
     self.assertEqual("The Form", doc.attrib["FormOID"])
     self.assertEqual("Field", doc.attrib["FieldOID"])
     self.assertEqual("TheVAR", doc.attrib["VariableOID"])
     self.assertEqual("1", doc.attrib["FormRepeatNumber"])
     self.assertEqual("2", doc.attrib["FolderRepeatNumber"])
     self.assertEqual("3", doc.attrib["RecordPosition"])
     self.assertEqual("CString", doc.attrib["String"])
     self.assertEqual("CScript", doc.attrib["Script"])
     self.assertEqual("COptions", doc.attrib["Options"])
     self.assertEqual(ActionType.SetDataPoint.value, doc.attrib["Type"])
Beispiel #4
0
 def test_builder(self):
     """XML produced"""
     tested = TranslatedText("A test", lang="en")
     doc = obj_to_doc(tested)
     self.assertEqual(doc.tag, "TranslatedText")
     self.assertEqual("en", doc.attrib["xml:lang"])
     self.assertEqual("A test", doc.text)
Beispiel #5
0
 def test_build_datastep(self):
     tested = MdsolDerivationStep(
         variable_oid="VAROID",
         field_oid="FIELDOID",
         form_oid="VFORM",
         folder_oid="MyFolder",
         record_position=0,
         form_repeat_number=2,
         folder_repeat_number=3,
         logical_record_position="MaxBySubject",
     )
     doc = obj_to_doc(tested)
     self.assertEqual("mdsol:DerivationStep", doc.tag)
     self.assertEqual("VAROID", doc.attrib["VariableOID"])
     self.assertEqual("FIELDOID", doc.attrib["FieldOID"])
     self.assertEqual("VFORM", doc.attrib["FormOID"])
     self.assertEqual("MyFolder", doc.attrib["FolderOID"])
     self.assertEqual("0", doc.attrib["RecordPosition"])
     self.assertEqual("2", doc.attrib["FormRepeatNumber"])
     self.assertEqual("3", doc.attrib["FolderRepeatNumber"])
     self.assertEqual("MaxBySubject", doc.attrib["LogicalRecordPosition"])
     # No data format param
     self.assertEqual("", doc.attrib.get("DataFormat", ""))
     # No function param
     self.assertEqual("", doc.attrib.get("Function", ""))
Beispiel #6
0
    def test_build(self):
        tested = MdsolLabelRef("OID1", 1)

        doc = obj_to_doc(tested)
        self.assertEqual(doc.tag, "mdsol:LabelRef")
        self.assertEqual("OID1", doc.attrib["LabelOID"])
        self.assertEqual("1", doc.attrib["OrderNumber"])
Beispiel #7
0
 def test_build_function(self):
     tested = MdsolDerivationStep(function=StepType.Add)
     doc = obj_to_doc(tested)
     self.assertEqual("mdsol:DerivationStep", doc.tag)
     self.assertEqual(StepType.Add.value, doc.attrib["Function"])
     # No data format param
     self.assertEqual("", doc.attrib.get("DataFormat", ""))
Beispiel #8
0
 def test_builder(self):
     tested = ItemGroupRef("ItemGroup1", 1, mandatory=True)
     doc = obj_to_doc(tested)
     self.assertEqual(doc.tag, "ItemGroupRef")
     self.assertEqual("ItemGroup1", doc.attrib["ItemGroupOID"])
     self.assertEqual("1", doc.attrib["OrderNumber"])
     self.assertEqual("Yes", doc.attrib["Mandatory"])
Beispiel #9
0
 def test_builder_no_lang(self):
     """XML produced when no lang is provided"""
     tested = TranslatedText("A test")
     doc = obj_to_doc(tested)
     self.assertEqual(doc.tag, "TranslatedText")
     self.assertEqual("", doc.get("xml:lang", ""))
     self.assertEqual("A test", doc.text)
Beispiel #10
0
    def test_builder(self):
        tested = StudyEventDef(
            "OID",
            "Name",
            False,
            StudyEventDef.SCHEDULED,
            category="Test Cat",
            access_days=1,
            start_win_days=2,
            target_days=3,
            end_win_days=4,
            overdue_days=5,
            close_days=6,
        )
        tested << FormRef("FORMOID", 1, False)

        doc = obj_to_doc(tested)
        self.assertEqual(doc.tag, "StudyEventDef")
        self.assertEqual("OID", doc.attrib["OID"])
        self.assertEqual("Name", doc.attrib["Name"])
        self.assertEqual("Scheduled", doc.attrib["Type"])
        self.assertEqual("Test Cat", doc.attrib["Category"])
        self.assertEqual("1", doc.attrib["mdsol:AccessDays"])
        self.assertEqual("2", doc.attrib["mdsol:StartWinDays"])
        self.assertEqual("3", doc.attrib["mdsol:TargetDays"])
        self.assertEqual("4", doc.attrib["mdsol:EndWinDays"])
        self.assertEqual("5", doc.attrib["mdsol:OverDueDays"])
        self.assertEqual("6", doc.attrib["mdsol:CloseDays"])
        self.assertEqual("FormRef", doc.getchildren()[0].tag)
Beispiel #11
0
    def test_build(self):
        tested = ItemGroupDef(
            "DM",
            "Demography",
            repeating=True,
            is_reference_data=True,
            sas_dataset_name="DMSAS",
            domain="TESTDOMAIN",
            origin="TESTORIGIN",
            role="TESTROLE",
            purpose="TESTPURPOSE",
            comment="A comment",
        )

        tested << ItemRef("OID1", 1)
        tested << MdsolLabelRef("LABEL1", 2)

        doc = obj_to_doc(tested)
        self.assertEqual(doc.tag, "ItemGroupDef")
        self.assertEqual("DM", doc.attrib["OID"])
        self.assertEqual("Yes", doc.attrib["Repeating"])
        self.assertEqual("Yes", doc.attrib["IsReferenceData"])
        self.assertEqual("Demography", doc.attrib["Name"])
        self.assertEqual("DMSAS", doc.attrib["SASDatasetName"])
        self.assertEqual("TESTDOMAIN", doc.attrib["Domain"])
        self.assertEqual("TESTORIGIN", doc.attrib["Origin"])
        self.assertEqual("TESTROLE", doc.attrib["Role"])
        self.assertEqual("TESTPURPOSE", doc.attrib["Purpose"])
        self.assertEqual("A comment", doc.attrib["Comment"])
        self.assertEqual("ItemRef", doc.getchildren()[0].tag)
        self.assertEqual("mdsol:LabelRef", doc.getchildren()[1].tag)
Beispiel #12
0
 def test_lang_default(self):
     tested = MdsolHeaderText("Content", "en")
     self.assertEqual("en", tested.lang)
     doc = obj_to_doc(tested)
     self.assertEqual("mdsol:HeaderText", doc.tag)
     self.assertEqual("Content", doc.text)
     self.assertEqual("en", doc.attrib["xml:lang"])
Beispiel #13
0
 def test_build(self):
     tested = MdsolDerivationStep(data_format="$1", value="1")
     doc = obj_to_doc(tested)
     self.assertEqual("mdsol:DerivationStep", doc.tag)
     self.assertEqual("$1", doc.attrib["DataFormat"])
     self.assertEqual("1", doc.attrib["Value"])
     # No function param
     self.assertEqual("", doc.attrib.get("Function", ""))
Beispiel #14
0
 def test_build_custom_function(self):
     tested = MdsolDerivationStep(custom_function="AlwaysTrue*")
     doc = obj_to_doc(tested)
     self.assertEqual("mdsol:DerivationStep", doc.tag)
     self.assertEqual("AlwaysTrue*", doc.attrib["CustomFunction"])
     # No data format param
     self.assertEqual("", doc.attrib.get("DataFormat", ""))
     # No function param
     self.assertEqual("", doc.attrib.get("Function", ""))
Beispiel #15
0
 def test_builder(self):
     """XML produced"""
     tested = CodeList("CL_YN", "YesNo", DataType.String, sas_format_name="YESNO_CL")
     tested << CodeListItem("Y")
     doc = obj_to_doc(tested)
     self.assertEqual("CodeList", doc.tag)
     self.assertEqual(DataType.String.value, doc.attrib["DataType"])
     self.assertEqual("YESNO_CL", doc.attrib["SASFormatName"])
     self.assertEqual("CodeListItem", doc.getchildren()[0].tag)
Beispiel #16
0
 def test_builder_basic(self):
     """XML produced"""
     tested = CodeListItem("Y")
     tested << Decode()
     doc = obj_to_doc(tested)
     self.assertEqual("CodeListItem", doc.tag)
     self.assertEqual("", doc.get("mdsol:Specify", ""))
     self.assertEqual("", doc.get("mdsol:OrderNumber", ""))
     self.assertEqual("Y", doc.attrib["CodedValue"])
     self.assertEqual("Decode", doc.getchildren()[0].tag)
Beispiel #17
0
 def test_builder_order_specify(self):
     """XML produced with optional params set"""
     tested = CodeListItem("Y", order_number=1, specify=True)
     tested << Decode()
     doc = obj_to_doc(tested)
     self.assertEqual("CodeListItem", doc.tag)
     self.assertEqual("Yes", doc.attrib["mdsol:Specify"])
     self.assertEqual("1", doc.attrib["mdsol:OrderNumber"])
     self.assertEqual("Y", doc.attrib["CodedValue"])
     self.assertEqual("Decode", doc.getchildren()[0].tag)
Beispiel #18
0
    def test_build(self):
        self.tested << TranslatedText("Please answer all questions")
        self.tested << MdsolViewRestriction("DM")

        doc = obj_to_doc(self.tested)
        self.assertEqual(doc.tag, "mdsol:LabelDef")
        self.assertEqual("L_AGE", doc.attrib["OID"])
        self.assertEqual("Age Label", doc.attrib["Name"])
        self.assertEqual("4", doc.attrib["FieldNumber"])
        self.assertEqual("TranslatedText", doc.getchildren()[0].tag)
        self.assertEqual("mdsol:ViewRestriction", doc.getchildren()[1].tag)
Beispiel #19
0
 def test_builder(self):
     """XML produced"""
     tested = Study("oid1", "GlobalLibrary Volume")(
         GlobalVariables("MY_TEST_PROJECT"), BasicDefinitions(), MetaDataVersion("OID", "NAME")
     )
     doc = obj_to_doc(tested)
     self.assertEqual(doc.tag, "Study")
     self.assertEqual(doc.attrib["mdsol:ProjectType"], "GlobalLibrary Volume")
     self.assertEqual(doc.getchildren()[0].tag, "GlobalVariables")
     self.assertEqual(doc.getchildren()[1].tag, "BasicDefinitions")
     self.assertEqual(doc.getchildren()[2].tag, "MetaDataVersion")
Beispiel #20
0
    def test_build(self):
        self.tested = RangeCheck(comparator=RangeCheckComparatorType.GreaterThanEqualTo, soft_hard=RangeCheckType.Soft)
        self.tested << CheckValue(0)
        self.tested << MeasurementUnitRef("kg")

        doc = obj_to_doc(self.tested)
        self.assertEqual("RangeCheck", doc.tag)
        self.assertEqual("Soft", doc.attrib["SoftHard"])
        self.assertEqual("GE", doc.attrib["Comparator"])
        self.assertEqual("CheckValue", doc.getchildren()[0].tag)
        self.assertEqual("MeasurementUnitRef", doc.getchildren()[1].tag)
Beispiel #21
0
    def test_build(self):
        self.tested << Question()(TranslatedText("How do you feel today?"))
        self.tested << CodeListRef("SCALE_1")
        self.tested << MeasurementUnitRef("Years")
        self.tested << MdsolHelpText("en", "Content of help")
        self.tested << MdsolViewRestriction("DM")
        self.tested << MdsolEntryRestriction("CRA")
        self.tested << MdsolHeaderText("YRS")
        self.tested << MdsolReviewGroup("CRA")
        self.tested << RangeCheck(RangeCheckComparatorType.LessThanEqualTo, RangeCheckType.Soft)

        doc = obj_to_doc(self.tested)
        self.assertEqual(doc.tag, "ItemDef")
        self.assertEqual("I_AGE", doc.attrib["OID"])
        self.assertEqual("Age", doc.attrib["Name"])
        self.assertEqual("Yes", doc.attrib["mdsol:Active"])
        self.assertEqual("integer", doc.attrib["DataType"])
        self.assertEqual("3", doc.attrib["Length"])
        self.assertEqual("Text", doc.attrib["mdsol:ControlType"])
        self.assertEqual("3", doc.attrib["SignificantDigits"])
        self.assertEqual("SAGE", doc.attrib["SASFieldName"])
        self.assertEqual("SVARNAME", doc.attrib["SDSVarName"])
        self.assertEqual("AGE_YRS", doc.attrib["mdsol:SASLabel"])
        self.assertEqual("3.0", doc.attrib["mdsol:SASFormat"])
        self.assertEqual("A comment", doc.attrib["Comment"])
        self.assertEqual("An origin", doc.attrib["Origin"])
        self.assertEqual("No", doc.attrib["mdsol:QueryFutureDate"])
        self.assertEqual("Yes", doc.attrib["mdsol:Visible"])
        self.assertEqual("Yes", doc.attrib["mdsol:TranslationRequired"])
        self.assertEqual("Yes", doc.attrib["mdsol:SourceDocument"])
        self.assertEqual("No", doc.attrib["mdsol:OtherVisits"])
        self.assertEqual("Yes", doc.attrib["mdsol:SourceDocument"])
        self.assertEqual("Yes", doc.attrib["mdsol:QueryNonConformance"])
        self.assertEqual("No", doc.attrib["mdsol:CanSetItemGroupDate"])
        self.assertEqual("No", doc.attrib["mdsol:CanSetFormDate"])
        self.assertEqual("No", doc.attrib["mdsol:CanSetStudyEventDate"])
        self.assertEqual("No", doc.attrib["mdsol:CanSetSubjectDate"])
        self.assertEqual("Yes", doc.attrib["mdsol:VisualVerify"])
        self.assertEqual("Yes", doc.attrib["mdsol:DoesNotBreakSignature"])
        self.assertEqual("SOMETHING_DIFFERENT", doc.attrib["mdsol:VariableOID"])
        self.assertEqual("jpg", doc.attrib["mdsol:AcceptableFileExtensions"])
        self.assertEqual("99", doc.attrib["mdsol:DefaultValue"])
        self.assertEqual("mmm yy dd", doc.attrib["mdsol:DateTimeFormat"])
        self.assertEqual("10", doc.attrib["mdsol:FieldNumber"])

        self.assertEqual("Question", doc.getchildren()[0].tag)
        self.assertEqual("CodeListRef", doc.getchildren()[1].tag)
        self.assertEqual("MeasurementUnitRef", doc.getchildren()[2].tag)
        self.assertEqual("RangeCheck", doc.getchildren()[3].tag)
        self.assertEqual("mdsol:HeaderText", doc.getchildren()[4].tag)
        self.assertEqual("mdsol:ViewRestriction", doc.getchildren()[5].tag)
        self.assertEqual("mdsol:EntryRestriction", doc.getchildren()[6].tag)
        self.assertEqual("mdsol:HelpText", doc.getchildren()[7].tag)
        self.assertEqual("mdsol:ReviewGroup", doc.getchildren()[8].tag)
Beispiel #22
0
 def test_builder(self):
     """XML produced"""
     tested = GlobalVariables("project_name", description="A description")
     doc = obj_to_doc(tested)
     self.assertEqual(doc.tag, "GlobalVariables")
     self.assertEqual(doc.getchildren()[0].tag, "StudyName")
     self.assertEqual("project_name", doc.getchildren()[0].text)
     self.assertEqual(doc.getchildren()[1].tag, "StudyDescription")
     self.assertEqual("A description", doc.getchildren()[1].text)
     self.assertEqual(doc.getchildren()[2].tag, "ProtocolName")
     self.assertEqual("project_name", doc.getchildren()[2].text)
Beispiel #23
0
    def test_build(self):
        tested = MdsolEditCheckDef("CHECK1")

        tested << MdsolCheckStep(data_format="$1", static_value="1")
        tested << MdsolCheckAction()

        doc = obj_to_doc(tested)
        self.assertEqual("mdsol:EditCheckDef", doc.tag)
        self.assertEqual("TRUE", doc.attrib["Active"])
        self.assertEqual("CHECK1", doc.attrib["OID"])
        self.assertEqual("FALSE", doc.attrib["NeedsRetesting"])
        self.assertEqual("FALSE", doc.attrib["BypassDuringMigration"])
        self.assertEqual("mdsol:CheckStep", doc.getchildren()[0].tag)
        self.assertEqual("mdsol:CheckAction", doc.getchildren()[1].tag)
Beispiel #24
0
    def test_build(self):
        tested = ItemRef(
            "OID1", 1, key_sequence=3, imputation_method_oid="IMPUTE1", role="AROLE", role_codelist_oid="ROLEX"
        )

        tested << MdsolAttribute("Namespace", "Name", "Value")
        tested << MdsolAttribute("Namespace2", "Name2", "Value2")

        doc = obj_to_doc(tested)
        self.assertEqual(doc.tag, "ItemRef")
        self.assertEqual("OID1", doc.attrib["ItemOID"])
        self.assertEqual("1", doc.attrib["OrderNumber"])
        self.assertEqual("3", doc.attrib["KeySequence"])
        self.assertEqual("IMPUTE1", doc.attrib["ImputationMethodOID"])
        self.assertEqual("AROLE", doc.attrib["Role"])
        self.assertEqual("ROLEX", doc.attrib["RoleCodeListOID"])
        self.assertEqual("mdsol:Attribute", doc.getchildren()[0].tag)
        self.assertEqual("mdsol:Attribute", doc.getchildren()[1].tag)
Beispiel #25
0
    def test_builder(self):
        """XML produced"""
        tested = MetaDataVersion(
            "OID",
            "NAME",
            description="A description",
            primary_formoid="DM",
            default_matrix_oid="DEFAULT",
            signature_prompt="I confirm.",
            delete_existing=True,
        )

        tested << Protocol()
        tested << StudyEventDef("OID", "Name", False, StudyEventDef.SCHEDULED)
        tested << FormDef("FORM_OID", "FORM_Name")
        tested << ItemGroupDef("IG_DEMO", "Demography")
        tested << ItemDef("ID_AGE", "Demography", DataType.Integer, 3)
        tested << CodeList("C_YESNO", "Yes No", DataType.String)
        tested << MdsolLabelDef("LABEL1", "first label")
        tested << MdsolConfirmationMessage("Form has been submitted!")
        tested << MdsolCustomFunctionDef("AlwaysTrue*", "return true;")
        tested << MdsolEditCheckDef("DM01")
        tested << MdsolDerivationDef("AGE")

        doc = obj_to_doc(tested)
        self.assertEqual(doc.tag, "MetaDataVersion")
        self.assertEqual("OID", doc.attrib["OID"])
        self.assertEqual("NAME", doc.attrib["Name"])
        self.assertEqual("A description", doc.attrib["Description"])
        self.assertEqual("DEFAULT", doc.attrib["mdsol:DefaultMatrixOID"])
        self.assertEqual("I confirm.", doc.attrib["mdsol:SignaturePrompt"])
        self.assertEqual("DM", doc.attrib["mdsol:PrimaryFormOID"])
        self.assertEqual("Yes", doc.attrib["mdsol:DeleteExisting"])
        self.assertEqual("Protocol", doc.getchildren()[0].tag)
        self.assertEqual("StudyEventDef", doc.getchildren()[1].tag)
        self.assertEqual("FormDef", doc.getchildren()[2].tag)
        self.assertEqual("ItemGroupDef", doc.getchildren()[3].tag)
        self.assertEqual("ItemDef", doc.getchildren()[4].tag)
        self.assertEqual("CodeList", doc.getchildren()[5].tag)
        self.assertEqual("mdsol:ConfirmationMessage", doc.getchildren()[6].tag)
        self.assertEqual("mdsol:LabelDef", doc.getchildren()[7].tag)
        self.assertEqual("mdsol:EditCheckDef", doc.getchildren()[8].tag)
        self.assertEqual("mdsol:DerivationDef", doc.getchildren()[9].tag)
        self.assertEqual("mdsol:CustomFunctionDef", doc.getchildren()[10].tag)
Beispiel #26
0
    def test_builder(self):
        tested = FormDef(
            "DM", "Demog", repeating=True, order_number=2, link_form_oid="FRM1", link_study_event_oid="EVT1"
        )

        tested << ItemGroupRef("ItemGroup1", 1)
        tested << MdsolHelpText("en", "This is a help text")
        tested << MdsolViewRestriction("DM")
        tested << MdsolEntryRestriction("CRA")

        doc = obj_to_doc(tested)
        self.assertEqual(doc.tag, "FormDef")
        self.assertEqual("DM", doc.attrib["OID"])
        self.assertEqual("Demog", doc.attrib["Name"])
        self.assertEqual("Yes", doc.attrib["Repeating"])
        self.assertEqual("2", doc.attrib["mdsol:OrderNumber"])
        # Would not see LinkFormOID and LinkStudyEventOID together, they are mutually exclusive. Just for coverage.
        self.assertEqual("FRM1", doc.attrib["mdsol:LinkFormOID"])
        self.assertEqual("EVT1", doc.attrib["mdsol:LinkStudyEventOID"])
        self.assertEqual("ItemGroupRef", doc.getchildren()[0].tag)
        self.assertEqual("mdsol:HelpText", doc.getchildren()[1].tag)
        self.assertEqual("mdsol:ViewRestriction", doc.getchildren()[2].tag)
        self.assertEqual("mdsol:EntryRestriction", doc.getchildren()[3].tag)
Beispiel #27
0
 def test_builder(self):
     """XML produced"""
     tested = BasicDefinitions()(MeasurementUnit("MU_OID", "MUNAME"))
     doc = obj_to_doc(tested)
     self.assertEqual(doc.tag, "BasicDefinitions")
     self.assertEqual(doc.getchildren()[0].tag, "MeasurementUnit")
Beispiel #28
0
 def test_builder(self):
     """XML produced"""
     tested = MeasurementUnit("MU_OID", "MU_NAME")(Symbol())
     doc = obj_to_doc(tested)
     self.assertEqual(doc.tag, "MeasurementUnit")
     self.assertEqual(doc.getchildren()[0].tag, "Symbol")
Beispiel #29
0
 def test_build(self):
     cm = MdsolConfirmationMessage("Form saved.")
     doc = obj_to_doc(cm)
     self.assertEqual("mdsol:ConfirmationMessage", doc.tag)
     self.assertEqual("Form saved.", doc.text)
Beispiel #30
0
 def test_lang_set(self):
     cm = MdsolConfirmationMessage("Form saved.", lang="en")
     doc = obj_to_doc(cm)
     self.assertEqual("en", doc.attrib["xml:lang"])