def setUp(self):
        edc_base_startup()
        try:
            site_lab_profiles.register(TestLabProfile())
        except AlreadyRegisteredLabProfile:
            pass

        self.configuration = TestAppConfiguration()
        self.configuration.prepare()
        consent_type = ConsentType.objects.first()
        consent_type.app_label = 'edc_testing'
        consent_type.model_name = 'testconsentwithmixin'
        consent_type.save()

        TestVisitSchedule().build()

        self.study_site = '40'
        self.identity = '111111111'
        self.visit_definition = VisitDefinition.objects.get(code='1000')
        subject_identifier = '999-100000-1'
        self.registered_subject = RegisteredSubjectFactory(
            subject_identifier=subject_identifier)
        self.test_consent = TestConsentWithMixinFactory(
            registered_subject=self.registered_subject,
            gender=MALE,
            dob=date.today() - relativedelta(years=35),
            study_site=self.study_site,
            identity=self.identity,
            confirm_identity=self.identity,
            subject_identifier='999-100000-1')
        self.appointment_count = VisitDefinition.objects.all().count()
        self.appointment = Appointment.objects.get(
            registered_subject=self.registered_subject,
            visit_definition=self.visit_definition)
def load_edc():

    if 'test' in sys.argv:
        f = open(os.path.join(
                 Path(os.path.dirname(os.path.realpath(__file__))).ancestor(1).child('td_maternal').child('tests'), 'test_randomization.csv'))
    # else:
    #    f = open(os.path.join(
    #             Path(os.path.dirname(os.path.realpath(__file__))).ancestor(2).child('etc'), 'randomization.csv'))
    # for index, line in enumerate(f.readlines()):
    #    if index == 0:
    #        continue
    #    seq, drug_assignment = line.split(',')
    #    RandomizationItem.objects.get_or_create(name=seq, field_name=drug_assignment)

    edc_base_startup()
    site_lab_profiles.autodiscover()
    AppConfiguration(lab_profiles=site_lab_profiles).prepare()
    site_visit_schedules.autodiscover()
    site_visit_schedules.build_all()
    site_rule_groups.autodiscover()
    data_manager.prepare()
    site_sections.autodiscover()
    site_sections.update_section_lists()
    site_model_callers.autodiscover()
    admin.autodiscover()
示例#3
0
def load_edc():

    if 'test' in sys.argv:
        f = open(
            os.path.join(
                Path(os.path.dirname(os.path.realpath(__file__))).ancestor(
                    1).child('td_maternal').child('tests'),
                'test_randomization.csv'))
    # else:
    #    f = open(os.path.join(
    #             Path(os.path.dirname(os.path.realpath(__file__))).ancestor(2).child('etc'), 'randomization.csv'))
    # for index, line in enumerate(f.readlines()):
    #    if index == 0:
    #        continue
    #    seq, drug_assignment = line.split(',')
    #    RandomizationItem.objects.get_or_create(name=seq, field_name=drug_assignment)

    edc_base_startup()
    site_lab_profiles.autodiscover()
    AppConfiguration(lab_profiles=site_lab_profiles).prepare()
    site_visit_schedules.autodiscover()
    site_visit_schedules.build_all()
    site_rule_groups.autodiscover()
    data_manager.prepare()
    site_sections.autodiscover()
    site_sections.update_section_lists()
    site_model_callers.autodiscover()
    admin.autodiscover()
示例#4
0
def load_edc():
    edc_base_startup()
    site_lab_profiles.autodiscover()
    AppConfiguration(lab_profiles=site_lab_profiles).prepare()
    site_visit_schedules.autodiscover()
    site_visit_schedules.build_all()
    site_rule_groups.autodiscover()
    data_manager.prepare()
    site_sections.autodiscover()
    site_sections.update_section_lists()
    site_model_callers.autodiscover()
    admin.autodiscover()

    for model in get_models():
        try:
            django_databrowse.site.register(model)
        except:
            pass
示例#5
0
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 Erik van Widenfelt
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
from django.conf.urls import include, url
from django.contrib import admin

from edc_base.utils import edc_base_startup
from edc_call_manager.caller_site import site_model_callers

edc_base_startup()
admin.autodiscover()
site_model_callers.autodiscover()

urlpatterns = [
    url(r'^admin/', include(admin.site.urls)),
]
 def setUp(self):
     edc_base_startup()