Commit 03e2456c authored by Håvard Farestveit's avatar Håvard Farestveit
Browse files

Removed wildcard import and cleaned code


cleaned code
parent d684d27c
Pipeline #125974 passed with stage
in 35 seconds
from users.tests.offers import *
from users.tests.offers import OfferTestCase
from users.tests.user_registration import UserRegistration2WayTestCase
from users.tests.user_serializer import UserSerializerTestCase
......@@ -33,16 +33,12 @@ class OfferTestCase(TestCase):
self.user2.save()
def _send_offer(self, user_id, status):
request = {}
request["status"] = status
request["recipient"] = "http://127.0.0.1:8000/api/users/{0}/".format(user_id)
request = {"status": status, "recipient": "http://127.0.0.1:8000/api/users/{0}/".format(user_id)}
response = self.client.post('/api/offers/', request)
return response.status_code
def _login(self, user):
request = {}
request["username"] = user.username
request["password"] = self.password
request = {"username": user.username, "password": self.password}
response = self.client.post('/api/token/', request)
access_token = response.data['access']
self.client.credentials(HTTP_AUTHORIZATION='Bearer ' + access_token)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment