Skip to content

Commit

Permalink
Use Python 3 style super() without arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
atodorov committed Aug 22, 2020
1 parent 38aeed8 commit 514ee11
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion tcms/kiwi_auth/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def clean_email(self):
_("A user with that email already exists."))

def save(self, commit=True):
user = super(RegistrationForm, self).save(commit=False)
user = super().save(commit=False)
user.email = self.cleaned_data['email']
user.is_active = False
user.set_password(self.cleaned_data["password1"])
Expand Down
2 changes: 1 addition & 1 deletion tcms/rpc/tests/test_category.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class TestCategory(APITestCase):

def _fixture_setup(self):
super(TestCategory, self)._fixture_setup()
super()._fixture_setup()

self.product_nitrate = ProductFactory(name='nitrate')
self.product_xmlrpc = ProductFactory(name='xmlrpc')
Expand Down
6 changes: 3 additions & 3 deletions tcms/rpc/tests/test_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class TestFilterComponents(APITestCase):
def _fixture_setup(self):
super(TestFilterComponents, self)._fixture_setup()
super()._fixture_setup()

self.product = ProductFactory(name='StarCraft')
self.component = ComponentFactory(name='application', product=self.product,
Expand All @@ -34,7 +34,7 @@ def test_filter_non_existing(self):
class TestCreateComponent(APITestCase):

def _fixture_setup(self):
super(TestCreateComponent, self)._fixture_setup()
super()._fixture_setup()

self.product = ProductFactory()

Expand All @@ -60,7 +60,7 @@ def test_add_component_with_no_perms(self):
class TestUpdateComponent(APITestCase):
# pylint: disable=objects-update-used
def _fixture_setup(self):
super(TestUpdateComponent, self)._fixture_setup()
super()._fixture_setup()

self.product = ProductFactory(name='StarCraft')
self.component = ComponentFactory(name="application", product=self.product,
Expand Down
2 changes: 1 addition & 1 deletion tcms/rpc/tests/test_plantype.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class PlanTypeMethods(APITestCase):

def _fixture_setup(self):
super(PlanTypeMethods, self)._fixture_setup()
super()._fixture_setup()

self.plan_type = PlanTypeFactory(name='xmlrpc plan type', description='')

Expand Down
2 changes: 1 addition & 1 deletion tcms/rpc/tests/test_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class TestFilter(APITestCase):

def _fixture_setup(self):
super(TestFilter, self)._fixture_setup()
super()._fixture_setup()

self.product = ProductFactory(name='Nitrate')
self.product_xmlrpc = ProductFactory(name='XMLRPC API')
Expand Down
2 changes: 1 addition & 1 deletion tcms/rpc/tests/test_tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class Tag(APITestCase):
def _fixture_setup(self):
super(Tag, self)._fixture_setup()
super()._fixture_setup()

self.tag_db = TagFactory(name='db')
self.tag_fedora = TagFactory(name='fedora')
Expand Down
6 changes: 3 additions & 3 deletions tcms/rpc/tests/test_testbuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class BuildCreate(APITestCase):

def _fixture_setup(self):
super(BuildCreate, self)._fixture_setup()
super()._fixture_setup()

self.product = ProductFactory()

Expand Down Expand Up @@ -84,7 +84,7 @@ def test_build_create(self):
class BuildUpdate(APITestCase):

def _fixture_setup(self):
super(BuildUpdate, self)._fixture_setup()
super()._fixture_setup()

self.product = ProductFactory()
self.another_product = ProductFactory()
Expand Down Expand Up @@ -128,7 +128,7 @@ def test_build_update(self):
class BuildFilter(APITestCase):

def _fixture_setup(self):
super(BuildFilter, self)._fixture_setup()
super()._fixture_setup()

self.product = ProductFactory()
self.build = BuildFactory(product=self.product)
Expand Down
6 changes: 3 additions & 3 deletions tcms/rpc/tests/test_testcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ class TestNotificationRemoveCC(APITestCase):
""" Tests the XML-RPC testcase.notication_remove_cc method """

def _fixture_setup(self):
super(TestNotificationRemoveCC, self)._fixture_setup()
super()._fixture_setup()

self.default_cc = 'example@MrSenko.com'
self.testcase = TestCaseFactory()
self.testcase.emailing.add_cc(self.default_cc)

def tearDown(self):
super(TestNotificationRemoveCC, self).tearDown()
super().tearDown()
self.rpc_client.Auth.logout()

def test_remove_existing_cc(self):
Expand All @@ -42,7 +42,7 @@ def test_remove_existing_cc(self):
class TestFilterCases(APITestCase):

def _fixture_setup(self):
super(TestFilterCases, self)._fixture_setup()
super()._fixture_setup()

self.tester = UserFactory(username='great tester')
self.product = ProductFactory(name='StarCraft')
Expand Down
8 changes: 4 additions & 4 deletions tcms/rpc/tests/test_testplan.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
class TestFilter(APITestCase):

def _fixture_setup(self):
super(TestFilter, self)._fixture_setup()
super()._fixture_setup()

self.product = ProductFactory()
self.version = VersionFactory(product=self.product)
Expand Down Expand Up @@ -51,7 +51,7 @@ def test_filter_out_all_plans(self):
class TestAddTag(APITestCase):

def _fixture_setup(self):
super(TestAddTag, self)._fixture_setup()
super()._fixture_setup()

self.product = ProductFactory()
self.plans = [
Expand Down Expand Up @@ -90,7 +90,7 @@ def test_add_tag_without_permissions(self):
class TestRemoveTag(APITestCase):

def _fixture_setup(self):
super(TestRemoveTag, self)._fixture_setup()
super()._fixture_setup()

self.product = ProductFactory()
self.plans = [
Expand Down Expand Up @@ -174,7 +174,7 @@ class TestRemoveCase(APITestCase):
""" Test the XML-RPC method TestPlan.remove_case() """

def _fixture_setup(self):
super(TestRemoveCase, self)._fixture_setup()
super()._fixture_setup()
self.testcase_1 = TestCaseFactory()
self.testcase_2 = TestCaseFactory()
self.plan_1 = TestPlanFactory()
Expand Down
4 changes: 2 additions & 2 deletions tcms/rpc/tests/test_testrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def test_should_remove_a_case_run(self):

class TestAddTag(APITestCase):
def _fixture_setup(self):
super(TestAddTag, self)._fixture_setup()
super()._fixture_setup()

self.product = ProductFactory()
self.version = VersionFactory()
Expand Down Expand Up @@ -156,7 +156,7 @@ def test_add_tag_without_permissions(self):

class TestRemoveTag(APITestCase):
def _fixture_setup(self):
super(TestRemoveTag, self)._fixture_setup()
super()._fixture_setup()

self.product = ProductFactory()
self.version = VersionFactory()
Expand Down
8 changes: 4 additions & 4 deletions tcms/rpc/tests/test_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class TestUserJoin(APITestCase):
"""Test User.join_group"""

def _fixture_setup(self):
super(TestUserJoin, self)._fixture_setup()
super()._fixture_setup()
# needs auth.change_user
self.api_user.is_superuser = True
self.api_user.save()
Expand Down Expand Up @@ -102,7 +102,7 @@ class TestUserUpdate(APITestCase):
"""Test User.update"""

def _fixture_setup(self):
super(TestUserUpdate, self)._fixture_setup()
super()._fixture_setup()

self.another_user = UserFactory()
self.another_user.set_password('another-password')
Expand All @@ -115,12 +115,12 @@ def _fixture_setup(self):
}

def setUp(self):
super(TestUserUpdate, self).setUp()
super().setUp()
# clear permissions b/c we set them inside individual tests
self.api_user.user_permissions.all().delete()

def tearDown(self):
super(TestUserUpdate, self).tearDown()
super().tearDown()
self.api_user.set_password('api-testing')
self.api_user.save()

Expand Down
2 changes: 1 addition & 1 deletion tcms/rpc/tests/test_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class TestFilterVersions(APITestCase):

def _fixture_setup(self):
super(TestFilterVersions, self)._fixture_setup()
super()._fixture_setup()

self.product = ProductFactory(name='StarCraft')
self.version = VersionFactory(value='0.7', product=self.product)
Expand Down
2 changes: 1 addition & 1 deletion tcms/testcases/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def to_python(self, value):

def clean(self, value):
email_addrs = self.to_python(value)
super_instance = super(MultipleEmailField, self)
super_instance = super()

valid_email_addrs = []
invalid_email_addrs = []
Expand Down
2 changes: 1 addition & 1 deletion tcms/tests/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ def url(self, name):
if (name not in self._files_found) and (name not in self._white_list):
raise Exception('Static file "%s" does not exist and will cause 404 errors!' % name)

return super(RaiseWhenFileNotFound, self).url(name)
return super().url(name)

0 comments on commit 514ee11

Please sign in to comment.