예제 #1
0
파일: tests.py 프로젝트: SlashRoot/WHAT
 def setUp(self):
     self.users = setUp_users_for_messages(self)
             
     self.group = Group.objects.create(name='test_group')
     self.group_party = GenericParty.objects.get(party=self.group)     
     
     do_set_up()
예제 #2
0
    def setUp(self):
        self.users = setUp_users_for_messages(self)

        self.group = Group.objects.create(name='test_group')
        self.group_party = GenericParty.objects.get(party=self.group)

        do_set_up()
예제 #3
0
파일: tests.py 프로젝트: SlashRoot/WHAT
 def setUp(self):
     do_set_up()
     service_config.set_up()
     
     mellon_set_up()
     set_up_privileges()
     
     slashroot_set_up()
     
     #Create a known number for people to call.
     operator = User.objects.create(username="******", first_name="Operator")
     UserProfile.objects.create(user=operator, contact_info=ContactInfo.objects.create())
     self.known_number = PhoneNumber.objects.create(owner=operator.userprofile.contact_info, number="+11231231234")
     
     
     #Create a member and login.
     rusty = User.objects.create(is_superuser=True, username="******", first_name="Rusty", last_name="Spike")
     UserProfile.objects.create(user=rusty, contact_info=ContactInfo.objects.create())
     member_role = FixedObject.objects.get(name="RoleInGroup__slashroot_holder").object
     UserInGroup.objects.create(role=member_role, user=rusty)
             
     rusty.set_password('password')
     rusty.save()
     
     self.client.login(username="******", password="******")
      
     PhoneNumber.objects.create(owner=rusty.userprofile.contact_info, number="+18456797712")
     self.call_from_member = create_phone_calls(1, from_user=rusty, to_number=self.known_number)[0]
     
     #Create a service / tech client.        
     martha = User.objects.create(username="******", first_name="Martha")
     martha.set_password('password')
     martha.save()
     
     response = self.client.post('/service/check_in/', {'customer':'auth.user_%s___%s' % (martha.id, martha.username), 'projected':'12/21/2012'}, follow=True)
     service = Service.objects.all()[0]        
     UserProfile.objects.create(user=service.recipient.user, contact_info=ContactInfo.objects.create())       
     PhoneNumber.objects.create(owner=service.recipient.user.userprofile.contact_info, number="+18456797779")
     self.call_from_client = create_phone_calls(1, from_user=service.recipient.user, to_number=self.known_number)[0]
     
     
     #Create an "other known caller."
     somebody_else = User.objects.create(username="******", first_name="somebody")
     UserProfile.objects.create(user=somebody_else, contact_info=ContactInfo.objects.create())
     PhoneNumber.objects.create(owner=somebody_else.userprofile.contact_info, number="+18456797723")
     self.call_from_other_known = create_phone_calls(1, from_user=somebody_else, to_number=self.known_number)[0]
     
     
     #Create an unknown caller.
     unknown_number = PhoneNumber.objects.create(number="+18456797756")
     self.call_from_unknown = create_phone_calls(1, from_number=unknown_number, to_number=self.known_number)[0]
예제 #4
0
 def setUp(self):
     setUp_users_for_messages(self)
     do_set_up()
예제 #5
0
파일: tests.py 프로젝트: SlashRoot/WHAT
 def setUp(self):
     do_set_up()
     self.users = test_user_factory(1)
예제 #6
0
파일: tests.py 프로젝트: jMyles/WHAT
 def setUp(self):
     do_set_up()
     self.users = test_user_factory(1)
예제 #7
0
파일: tests.py 프로젝트: SlashRoot/WHAT
 def setUp(self):
     setUp_users_for_messages(self)
     do_set_up()
예제 #8
0
    def setUp(self):
        do_set_up()
        service_config.set_up()

        mellon_set_up()
        set_up_privileges()

        slashroot_set_up()

        #Create a known number for people to call.
        operator = User.objects.create(username="******",
                                       first_name="Operator")
        UserProfile.objects.create(user=operator,
                                   contact_info=ContactInfo.objects.create())
        self.known_number = PhoneNumber.objects.create(
            owner=operator.userprofile.contact_info, number="+11231231234")

        #Create a member and login.
        rusty = User.objects.create(is_superuser=True,
                                    username="******",
                                    first_name="Rusty",
                                    last_name="Spike")
        UserProfile.objects.create(user=rusty,
                                   contact_info=ContactInfo.objects.create())
        member_role = FixedObject.objects.get(
            name="RoleInGroup__slashroot_holder").object
        UserInGroup.objects.create(role=member_role, user=rusty)

        rusty.set_password('password')
        rusty.save()

        self.client.login(username="******", password="******")

        PhoneNumber.objects.create(owner=rusty.userprofile.contact_info,
                                   number="+18456797712")
        self.call_from_member = create_phone_calls(
            1, from_user=rusty, to_number=self.known_number)[0]

        #Create a service / tech client.
        martha = User.objects.create(username="******", first_name="Martha")
        martha.set_password('password')
        martha.save()

        response = self.client.post(
            '/service/check_in/', {
                'customer': 'auth.user_%s___%s' % (martha.id, martha.username),
                'projected': '12/21/2012'
            },
            follow=True)
        service = Service.objects.all()[0]
        UserProfile.objects.create(user=service.recipient.user,
                                   contact_info=ContactInfo.objects.create())
        PhoneNumber.objects.create(
            owner=service.recipient.user.userprofile.contact_info,
            number="+18456797779")
        self.call_from_client = create_phone_calls(
            1, from_user=service.recipient.user,
            to_number=self.known_number)[0]

        #Create an "other known caller."
        somebody_else = User.objects.create(username="******",
                                            first_name="somebody")
        UserProfile.objects.create(user=somebody_else,
                                   contact_info=ContactInfo.objects.create())
        PhoneNumber.objects.create(
            owner=somebody_else.userprofile.contact_info,
            number="+18456797723")
        self.call_from_other_known = create_phone_calls(
            1, from_user=somebody_else, to_number=self.known_number)[0]

        #Create an unknown caller.
        unknown_number = PhoneNumber.objects.create(number="+18456797756")
        self.call_from_unknown = create_phone_calls(
            1, from_number=unknown_number, to_number=self.known_number)[0]