diff --git a/junction/devices/models.py b/junction/devices/models.py index a67faff2..4f4effc0 100644 --- a/junction/devices/models.py +++ b/junction/devices/models.py @@ -27,4 +27,4 @@ class Device(TimeAuditModel): ) def __unicode__(self): - return u"uuid: {}, is_verified: {}".format(self.uuid, self.is_verified) + return "uuid: {}, is_verified: {}".format(self.uuid, self.is_verified) diff --git a/junction/schedule/models.py b/junction/schedule/models.py index d3f94865..109a06d6 100644 --- a/junction/schedule/models.py +++ b/junction/schedule/models.py @@ -57,7 +57,7 @@ class ScheduleItem(AuditModel): conference = models.ForeignKey(Conference, on_delete=models.CASCADE) def __unicode__(self): - return u"{} - {} on {} from {} to {} in {}".format( + return "{} - {} on {} from {} to {} in {}".format( self.conference, self.name, self.event_date, @@ -90,9 +90,7 @@ def to_response(self, request): } if self.session: session = self.session - author = u"{} {}".format( - session.author.first_name, session.author.last_name - ) + author = "{} {}".format(session.author.first_name, session.author.last_name) data["session"] = { "id": session.id, "title": session.title, diff --git a/junction/tickets/management/commands/explara.py b/junction/tickets/management/commands/explara.py index cd350e39..80215ecf 100644 --- a/junction/tickets/management/commands/explara.py +++ b/junction/tickets/management/commands/explara.py @@ -12,7 +12,7 @@ class Explara(object): def __init__(self, access_token): self.access_token = access_token - self.headers = {"Authorization": u"Bearer " + self.access_token} + self.headers = {"Authorization": "Bearer " + self.access_token} self.base_url = "https://www.explara.com/api/e/{0}" def get_events(self): diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..6f960fc5 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,20 @@ +[tool.black] +line-length = 88 +target-version = ['py35', 'py36', 'py37'] +include = '\.pyi?$' +exclude = ''' +/( + \.eggs + | \.git + | \.mypy_cache + | \.tox + | \.venv + | _build + | buck-out + | build + | dist + | settings + | docs + | +)/ +''' diff --git a/tests/integrations/test_feedback_api.py b/tests/integrations/test_feedback_api.py index 14aa7e01..21b98174 100644 --- a/tests/integrations/test_feedback_api.py +++ b/tests/integrations/test_feedback_api.py @@ -160,10 +160,10 @@ def test_feedback_with_wrong_choice_value(self): self.client.credentials(HTTP_AUTHORIZATION="Token " + str(self.device.uuid)) res = self.client.post("/api/v1/feedback/", data, format="json") - msg = u"The multiple choice value isn't associated with question" + msg = "The multiple choice value isn't associated with question" assert res.status_code == status.HTTP_400_BAD_REQUEST - assert res.data == {"choices": [{u"non_field_errors": [msg]}]} + assert res.data == {"choices": [{"non_field_errors": [msg]}]} def test_feedback_with_missing_required_text_data(self): choice = [