-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
clean up python 2 compatible changes (#71)
- Loading branch information
M. Zulqarnain
authored
Aug 20, 2020
1 parent
0111cd9
commit 0c732fa
Showing
29 changed files
with
29 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
URLs for REST API schema generation. | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
# pylint: disable=C0111,W6005,W6100 | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
URLs for user_tasks test suite. | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Tests for the ``django-user-tasks`` admin module. | ||
""" | ||
|
@@ -14,7 +13,7 @@ class AdminTestCase(TestCase): | |
Tests for the ``user_tasks`` application's Django admin pages. | ||
""" | ||
def setUp(self): | ||
super(AdminTestCase, self).setUp() | ||
super().setUp() | ||
self.user = User.objects.create_user( | ||
username='tester', | ||
email='[email protected]', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Tests for the `django-user-tasks` models module. | ||
""" | ||
|
@@ -26,7 +25,7 @@ class TestUserTaskStatus(TestCase): | |
|
||
@classmethod | ||
def setUpTestData(cls): | ||
super(TestUserTaskStatus, cls).setUpTestData() | ||
super().setUpTestData() | ||
cls.user = User.objects.create_user('test_user', '[email protected]', 'password') | ||
|
||
def test_cancel_parent(self): | ||
|
@@ -206,7 +205,7 @@ class TestUserTaskArtifact(TestCase): | |
|
||
@classmethod | ||
def setUpTestData(cls): | ||
super(TestUserTaskArtifact, cls).setUpTestData() | ||
super().setUpTestData() | ||
cls.user = User.objects.create_user('test_user', '[email protected]', 'password') | ||
|
||
def test_file_string(self): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Tests for the ``django-user-tasks`` REST API. | ||
""" | ||
|
@@ -47,17 +46,17 @@ class TestRestApi(APITestCase): | |
|
||
@classmethod | ||
def setUpClass(cls): | ||
super(TestRestApi, cls).setUpClass() | ||
super().setUpClass() | ||
add_rules() | ||
|
||
@classmethod | ||
def tearDownClass(cls): | ||
super(TestRestApi, cls).tearDownClass() | ||
super().tearDownClass() | ||
rules.rulesets.default_rules.clear() | ||
|
||
@classmethod | ||
def setUpTestData(cls): | ||
super(TestRestApi, cls).setUpTestData() | ||
super().setUpTestData() | ||
cls.user = User.objects.create_user('test_user', '[email protected]', 'password') | ||
cls.superuser = User.objects.create_superuser('admin', '[email protected]', 'password') | ||
cls.other_user = User.objects.create_user('other_user', '[email protected]', 'password') | ||
|
@@ -72,7 +71,7 @@ def setUpTestData(cls): | |
UserTaskStatus.objects.filter(pk=cls.older_status.id).update(created=yesterday, modified=yesterday) | ||
|
||
def setUp(self): | ||
super(TestRestApi, self).setUp() | ||
super().setUp() | ||
self.status.refresh_from_db() | ||
self.older_status.refresh_from_db() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Tests for the REST API model serializers. | ||
""" | ||
|
@@ -34,7 +33,7 @@ class TestStatusSerializer(TestCase): | |
|
||
@classmethod | ||
def setUpTestData(cls): | ||
super(TestStatusSerializer, cls).setUpTestData() | ||
super().setUpTestData() | ||
cls.user = User.objects.create_user('test_user', '[email protected]', 'password') | ||
|
||
def test_output(self): | ||
|
@@ -81,13 +80,13 @@ class TestArtifactSerializer(TestCase): | |
|
||
@classmethod | ||
def setUpTestData(cls): | ||
super(TestArtifactSerializer, cls).setUpTestData() | ||
super().setUpTestData() | ||
user = User.objects.create_user('test_user', '[email protected]', 'password') | ||
cls.status = UserTaskStatus.objects.create(user=user, task_id=str(uuid4()), name='SampleTask', total_steps=4) | ||
|
||
@classmethod | ||
def tearDownClass(cls): | ||
super(TestArtifactSerializer, cls).tearDownClass() | ||
super().tearDownClass() | ||
# Clean up temp files | ||
shutil.rmtree(settings.MEDIA_ROOT) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Tests for the ``django-user-tasks`` Celery signal handlers and Django signal. | ||
""" | ||
|
@@ -99,12 +98,12 @@ class TestCreateUserTask(TestCase): | |
""" | ||
|
||
def tearDown(self): | ||
super(TestCreateUserTask, self).tearDown() | ||
super().tearDown() | ||
SIGNAL_DATA.clear() | ||
|
||
@classmethod | ||
def setUpTestData(cls): | ||
super(TestCreateUserTask, cls).setUpTestData() | ||
super().setUpTestData() | ||
cls.user = User.objects.create_user('test_user', '[email protected]', 'password') | ||
|
||
def test_create_user_task(self): | ||
|
@@ -380,12 +379,12 @@ class TestStatusChanges(TestCase): | |
""" | ||
|
||
def tearDown(self): | ||
super(TestStatusChanges, self).tearDown() | ||
super().tearDown() | ||
SIGNAL_DATA.clear() | ||
|
||
@classmethod | ||
def setUpTestData(cls): | ||
super(TestStatusChanges, cls).setUpTestData() | ||
super().setUpTestData() | ||
cls.user = User.objects.create_user('test_user', '[email protected]', 'password') | ||
|
||
def test_canceled_before_execution(self): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Tests for the user_tasks subclasses of celery.Task. | ||
""" | ||
|
@@ -67,7 +66,7 @@ class TestUserTasks(TestCase): | |
|
||
@classmethod | ||
def setUpTestData(cls): | ||
super(TestUserTasks, cls).setUpTestData() | ||
super().setUpTestData() | ||
cls.user = User.objects.create_user('test_user', '[email protected]', 'password') | ||
|
||
def test_generate_name_omitted(self): | ||
|
@@ -114,7 +113,7 @@ class TestPurgeOldUserTasks(TestCase): | |
|
||
@classmethod | ||
def setUpTestData(cls): | ||
super(TestPurgeOldUserTasks, cls).setUpTestData() | ||
super().setUpTestData() | ||
cls.user = User.objects.create_user('test_user', '[email protected]', 'password') | ||
|
||
def test_old_data(self): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Django admin configuration for the ``django-user-tasks`` models. | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
user_tasks Django application initialization. | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Custom Django settings for django-user-tasks. | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Custom exception classes. | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.10.1 on 2016-09-07 20:22 | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.10.2 on 2016-12-05 16:12 | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.11.20 on 2019-05-29 13:03 | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.11.20 on 2019-05-29 17:51 | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
REST API serialization classes. | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Celery signal handlers and custom Django signal. | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Celery task abstract base classes. | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
URLs for user_tasks. | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
REST API endpoints. | ||
""" | ||
|