def setUp(self):
        element_data = join('utils', 'XSDParser', 'tests', 'data', 'parser', 'element')
        self.element_data_handler = DataHandler(element_data)

        self.request = HttpRequest()
        engine = import_module('django.contrib.sessions.backends.db')
        session_key = None
        self.request.session = engine.SessionStore(session_key)

        self.maxDiff = None

        self.request.session['curate_edit'] = False  # Data edition
        self.request.session['nb_html_tags'] = 0
        self.request.session['mapTagID'] = {}
        self.request.session['nbChoicesID'] = 0

        # set default namespace
        namespace = "http://www.w3.org/2001/XMLSchema"
        self.namespace = "{" + namespace + "}"
        self.request.session['defaultPrefix'] = 'xs'
        self.request.session['namespaces'] = {'xs': namespace}

        from utils.XSDParser import parser
        from curate.ajax import load_config
        parser.load_config(self.request, load_config())
    def setUp(self):
        complex_type_data = join('utils', 'XSDParser', 'tests', 'data',
                                 'parser', 'complex_type')
        self.complex_type_data_handler = DataHandler(complex_type_data)

        self.maxDiff = None

        self.request = HttpRequest()
        engine = import_module('django.contrib.sessions.backends.db')
        session_key = None
        self.request.session = engine.SessionStore(session_key)

        self.request.session['curate_edit'] = False  # Data edition
        self.request.session['nb_html_tags'] = 0
        self.request.session['mapTagID'] = {}
        self.request.session['nbChoicesID'] = 0
        self.request.session['implicit_extension'] = True
        self.request.session['keys'] = {}
        self.request.session['keyrefs'] = {}

        # set default namespace
        namespace = "http://www.w3.org/2001/XMLSchema"
        self.namespace = "{" + namespace + "}"
        self.request.session['defaultPrefix'] = 'xs'
        self.request.session['namespaces'] = {'xs': namespace}

        from utils.XSDParser import parser
        from curate.ajax import load_config
        parser.load_config(self.request, load_config())
Esempio n. 3
0
    def setUp(self):
        simple_content_data = join('utils', 'XSDParser', 'tests', 'data', 'parser', 'simple_content')
        self.simple_content_data_handler = DataHandler(simple_content_data)

        self.maxDiff = None

        self.request = HttpRequest()
        engine = import_module('django.contrib.sessions.backends.db')
        session_key = None
        self.request.session = engine.SessionStore(session_key)

        self.request.session['curate_edit'] = True  # Data edition
        self.request.session['nb_html_tags'] = 0
        self.request.session['mapTagID'] = {}
        self.request.session['nbChoicesID'] = 0
        self.request.session['keys'] = {}
        self.request.session['keyrefs'] = {}

        # set default namespace
        self.namespace = {
            'xs': SCHEMA_NAMESPACE
        }
        self.request.session['defaultPrefix'] = 'xs'
        self.request.session['namespaces'] = self.namespace

        from utils.XSDParser import parser
        from curate.ajax import load_config
        parser.load_config(self.request, load_config())
Esempio n. 4
0
    def setUp(self):
        extension_data = join('utils', 'XSDParser', 'tests', 'data', 'parser',
                              'extension')
        self.extension_data_handler = DataHandler(extension_data)

        self.maxDiff = None

        engine = import_module(settings.SESSION_ENGINE)
        store = engine.SessionStore()

        # Session dictionary update
        store['curate_edit'] = True  # Data edition
        store['nb_html_tags'] = 0
        store['mapTagID'] = {}
        store['nbChoicesID'] = 0
        store['keys'] = {}
        store['keyrefs'] = {}

        # set default namespace
        self.namespace = "{" + SCHEMA_NAMESPACE + "}"
        store['defaultPrefix'] = 'xs'
        store['namespaces'] = {'xs': SCHEMA_NAMESPACE}

        store.save()
        self.session = store

        self.request = HttpRequest()
        self.request.session = self.session

        from utils.XSDParser import parser
        from curate.ajax import load_config
        parser.load_config(self.request, load_config())
    def setUp(self):
        extension_data = join('utils', 'XSDParser', 'tests', 'data', 'parser', 'extension')
        self.extension_data_handler = DataHandler(extension_data)

        self.maxDiff = None

        engine = import_module(settings.SESSION_ENGINE)
        store = engine.SessionStore()

        # Session dictionary update
        store['curate_edit'] = True  # Data edition
        store['nb_html_tags'] = 0
        store['mapTagID'] = {}
        store['nbChoicesID'] = 0
        store['keys'] = {}
        store['keyrefs'] = {}

        # set default namespace
        self.namespace = "{" + SCHEMA_NAMESPACE + "}"
        store['defaultPrefix'] = 'xs'
        store['namespaces'] = {'xs': SCHEMA_NAMESPACE}

        store.save()
        self.session = store

        self.request = HttpRequest()
        self.request.session = self.session

        from utils.XSDParser import parser
        from curate.ajax import load_config
        parser.load_config(self.request, load_config())
    def setUp(self):
        choice_data = join("utils", "XSDParser", "tests", "data", "parser", "choice")
        self.choice_data_handler = DataHandler(choice_data)

        self.maxDiff = None

        self.request = HttpRequest()
        engine = import_module("django.contrib.sessions.backends.db")
        session_key = None
        self.request.session = engine.SessionStore(session_key)

        self.request.session["curate_edit"] = False  # Data edition
        self.request.session["nb_html_tags"] = 0
        self.request.session["mapTagID"] = {}
        self.request.session["nbChoicesID"] = 0

        # set default namespace
        namespace = "http://www.w3.org/2001/XMLSchema"
        self.namespace = "{" + namespace + "}"
        self.request.session["defaultPrefix"] = "xs"
        self.request.session["namespaces"] = {"xs": namespace}

        from utils.XSDParser import parser
        from curate.ajax import load_config

        parser.load_config(self.request, load_config())
Esempio n. 7
0
    def setUp(self):
        # connect to test database
        # self.db_name = "mgi_test"
        # disconnect()
        # connect(self.db_name, port=27018)

        module_data = join('utils', 'XSDParser', 'tests', 'data', 'parser',
                           'utils', 'modules')
        self.module_data_handler = DataHandler(module_data)

        self.request = HttpRequest()
        engine = import_module('django.contrib.sessions.backends.db')
        session_key = None
        self.request.session = engine.SessionStore(session_key)

        from utils.XSDParser import parser
        from curate.ajax import load_config
        parser.load_config(self.request, load_config())
    def setUp(self):
        # connect to test database
        # self.db_name = "mgi_test"
        # disconnect()
        # connect(self.db_name, port=27018)

        module_data = join("utils", "XSDParser", "tests", "data", "parser", "utils", "modules")
        self.module_data_handler = DataHandler(module_data)

        self.request = HttpRequest()
        engine = import_module("django.contrib.sessions.backends.db")
        session_key = None
        self.request.session = engine.SessionStore(session_key)

        from utils.XSDParser import parser
        from curate.ajax import load_config

        parser.load_config(self.request, load_config())