Exemplo n.º 1
0
 def setUp(self):
     do_config.set_up()
     admin = User.objects.create(is_superuser=True, username="******", password="******")
     admin.set_password('admin')
     admin.save()
     set_up_providers(self)
     slashroot_set_up()
Exemplo n.º 2
0
Arquivo: tests.py Projeto: jMyles/WHAT
 def setUp(self):
     do_config.set_up()
     admin = User.objects.create(is_superuser=True,
                                 username="******",
                                 password="******")
     admin.set_password('admin')
     admin.save()
     set_up_providers(self)
     slashroot_set_up()
Exemplo n.º 3
0
 def setUp(self):
     cache.clear()
     slashroot_set_up()
     self.rusty = User.objects.create(is_superuser=True, username="******", first_name="Rusty", last_name="Spike")
     UserProfile.objects.create(user=self.rusty, contact_info=ContactInfo.objects.create())
     member_role = FixedObject.objects.get(name="RoleInGroup__slashroot_holder").object
     UserInGroup.objects.create(role=member_role, user=self.rusty)
             
     self.rusty.set_password('password')
     self.rusty.save()
     
     self.client.login(username="******", password="******")
Exemplo n.º 4
0
 def setUp(self):
     do_setup()
     service_setup()
     
     mellon_setup()
     set_up_privileges()
     
     slashroot_set_up()
     
     self.admin = User.objects.create(is_superuser=True, username="******", password="******", first_name="Youhan")
     self.admin.set_password('admin')
     self.admin.save()
Exemplo n.º 5
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]
Exemplo n.º 6
0
Arquivo: tests.py Projeto: jMyles/WHAT
    def setUp(self):
        do_setup()
        service_setup()

        mellon_setup()
        set_up_privileges()

        slashroot_set_up()

        self.admin = User.objects.create(is_superuser=True,
                                         username="******",
                                         password="******",
                                         first_name="Youhan")
        self.admin.set_password('admin')
        self.admin.save()
Exemplo n.º 7
0
    def setUp(self):
        cache.clear()
        slashroot_set_up()
        self.rusty = User.objects.create(is_superuser=True,
                                         username="******",
                                         first_name="Rusty",
                                         last_name="Spike")
        UserProfile.objects.create(user=self.rusty,
                                   contact_info=ContactInfo.objects.create())
        member_role = FixedObject.objects.get(
            name="RoleInGroup__slashroot_holder").object
        UserInGroup.objects.create(role=member_role, user=self.rusty)

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

        self.client.login(username="******", password="******")
Exemplo n.º 8
0
Arquivo: tests.py Projeto: jMyles/WHAT
 def setUp(self):
     slashroot_set_up()
Exemplo n.º 9
0
 def setUp(self):
     slashroot_set_up()
Exemplo n.º 10
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]