Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jesperhodge committed Feb 24, 2025
1 parent 2c6725d commit de32ef1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@

from django.contrib import auth
from django.core.management.base import BaseCommand
from django.db import transaction, DatabaseError
from django.db import DatabaseError, transaction

from enterprise.models import EnterpriseCustomerUser


log = logging.getLogger(__name__)
User = auth.get_user_model()

Expand Down Expand Up @@ -104,8 +103,7 @@ def backfill_ecu_table_user_foreign_key(self, options):

log.info(f"Backfill complete! Processed {total_processed}/{total_rows} records.")


def handle(self, *args, **options): # pylint: disable=unused-argument
def handle(self, *_args, **options):
"""
Entry point for management command execution.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@
from django.db.models import signals
from django.test import TestCase

from enterprise.models import EnterpriseCustomerUser, EnterpriseCustomer
from enterprise.models import EnterpriseCustomer, EnterpriseCustomerUser
from test_utils import factories

EXCEPTION = "DUMMY_TRACE_BACK"

User = auth.get_user_model()


@mark.django_db
@ddt.ddt
class CreateEnterpriseCourseEnrollmentCommandTests(TestCase):
Expand Down Expand Up @@ -83,8 +85,8 @@ def test_skips_rows_that_already_have_user_fk(self):
@patch('logging.Logger.warning')
def test_retry_5_times_on_failure(self, mock_log):
with patch(
("enterprise.management.commands.backfill_ecu_table_user_foreign_key."
"EnterpriseCustomerUser.objects.bulk_update"),
("enterprise.management.commands.backfill_ecu_table_user_foreign_key." +
"EnterpriseCustomerUser.objects.bulk_update"),
side_effect=Exception(EXCEPTION)
):
with self.assertRaises(Exception) as e:
Expand Down

0 comments on commit de32ef1

Please sign in to comment.