示例#1
0
def setup_required_service():
    service_type = ServiceType()
    service_type.name = "Tipo de Servico"
    service_type.save()

    area1 = Area()
    area1.area_name = "area 1"
    area1.save()

    organization1 = Organization.objects.get(name=user_stub()["organization"])

    service1 = Service()
    service1.area = area1
    service1.name = "Servico 1"
    service1.organization = organization1
    service1.service_type = service_type
    service1.save()

    a = AdmissionChoice()
    a.weight = 1
    a.save()

    u = User()
    u.username = "******"
    u.password = "******"
    u.is_superuser = True
    u.save()

    person = Person()
    person.name = "nome12"
    person.user = u
    person.nickname = "apelido12"
    person.save()
    person.organization.add(organization1)
    person.save()
示例#2
0
def setup_required_service():
    service_type = ServiceType()
    service_type.name="Tipo de Servico"
    service_type.save()

    area1 = Area()
    area1.area_name = "area 1"
    area1.save()

    organization1 = Organization.objects.get(name=user_stub()["organization"])

    service1 = Service()
    service1.area = area1;
    service1.name = "Servico 1"
    service1.organization = organization1
    service1.service_type = service_type
    service1.save()

    a = AdmissionChoice()
    a.weight = 1
    a.save()

    u = User()
    u.username = "******"
    u.password = "******"
    u.is_superuser = True
    u.save()

    person = Person()
    person.name = "nome12"
    person.user = u
    person.nickname = "apelido12"
    person.save()
    person.organization.add(organization1)
    person.save()
示例#3
0
    def setUp(self):
        self.factory = RequestFactory()
        p = Person()

        User.objects.create(username="******", password="******")      
        p.user = User.objects.get(username="******")

        p.save()

        client = Client(person=p, idRecord=1)
        client.save()

        self.person = Person.objects.get(user_id=p.user.id)
示例#4
0
    def setUp(self):
        person = Person()

        User.objects.create(username="******", password="******")
        person.user = User.objects.get(username="******")

        person.birthDate = "1990-05-14"
        person.birthForeignCity = "Melbourne"
        person.birthForeignState = "Victoria"
        person.birthForeignCountry = '1'

        person.save()

        contentType = ContentType()
        contentType.app_label = "auth"
        contentType.model = "any"
        contentType.save()

        emailType = EmailType()
        emailType.description = "Email Type"
        emailType.save()
        email = Email()
        email.email = "*****@*****.**"
        email.email_type = EmailType.objects.all()[0]
        email.content_object = person
        email.save()

        site = Site()
        site.description = "this is a website"
        site.site = "www.google.com.br"
        site.content_object = person
        site.save()

        person.save()

        self.p = Person.objects.get(user_id=person.user.id)

        def tearDown(self):
            for person in Person.objects.all():
                person.delete()

            for user in User.objects.all():
                user.delete()
示例#5
0
    def setUp(self):
        person = Person()
		
        User.objects.create(username="******", password="******")		
        person.user = User.objects.get(username="******")
	    
        person.birthDate = "1990-05-14"
        person.birthForeignCity = "Melbourne"
        person.birthForeignState = "Victoria"
        person.birthForeignCountry = '1'
        
        person.save()
        
        contentType = ContentType()
        contentType.app_label = "auth"
        contentType.model = "any"
        contentType.save()
        
        emailType = EmailType()
        emailType.description = "Email Type"
        emailType.save()
        email = Email()
        email.email = "*****@*****.**"
        email.email_type = EmailType.objects.all()[0]
        email.content_object = person
        email.save()

        site = Site()
        site.description = "this is a website"
        site.site = "www.google.com.br"
        site.content_object = person
        site.save()

        person.save()

        self.p = Person.objects.get(user_id=person.user.id)

	def tearDown(self):
	    for person in Person.objects.all():
	        person.delete()

	    for user in User.objects.all():
	        user.delete()