Esempio n. 1
0
 def setUp(self):
     make_everything()
     self.user = PhoneAuthUser.objects.create(phone='777')
     self.client_object = make_client(self.user)
     token, _ = Token.objects.get_or_create(client=self.client_object)
     self.client = APIClient()
     self.client.credentials(HTTP_AUTHORIZATION=f'Token {token.key}')
Esempio n. 2
0
 def setUp(self):
     make_everything()
     self.master_object = Master.objects.get(first_name='VASYA')
     self.client_object = make_client()
     self.order, _ = make_order(self.client_object,
                                self.master_object.services.all()[0],
                                self.master_object,
                                order_date=timezone.now() + delta(days=1),
                                order_time='11:30')
     self.user = self.client_object.user
     token, _ = Token.objects.get_or_create(client=self.client_object)
     self.client = APIClient()
     self.client.credentials(HTTP_AUTHORIZATION=f'Token {token.key}')