Ejemplo n.º 1
0
    def test_factory_fields(self):
        "Testing factory module that generates fields"

        # All valid field types.
        field_types = factory.get_field_types()

        for display_type in field_types:

            # Test that each field type can be rendered.
            json_data = dict(display=display_type)

            field = factory.dynamic_field(json_data)
            if not field:
                message = f"field generator for display={display_type} failed"
                self.assertFalse(message)
Ejemplo n.º 2
0
    def test_dynamic_field(self):
        "Test data generator"

        from biostar.recipes import const

        data = auth.create_data(self.project, path=__file__)

        display_type = const.DROPDOWN

        json_data = dict(display=display_type, value=data.name,
                         source= 'PROJECT')

        field = factory.dynamic_field(json_data, project=self.project)

        if not field:
            self.assertFalse(f"field generator for display={display_type} failed")