Skip to content

Commit

Permalink
fix: Stop using testing code
Browse files Browse the repository at this point in the history
  • Loading branch information
bmtcril committed Mar 12, 2024
1 parent a24a56e commit e045aa3
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,8 @@ def __init__(self, num_users: int, username_prefix: str):
username=f"instructor_{course_shortname}",
name="Instructor",
password="aspects",
email=f"instructor_{course_shortname}@openedx.invalid",
is_active=True
email=f"instructor_{course_shortname}@openedx.invalid"
)
self.instructor.is_active = True
self.instructor.save()

start_date = datetime.now() - timedelta(days=7)

Check warning on line 51 in platform_plugin_aspects/management/commands/load_test_tracking_events.py

View check run for this annotation

Codecov / codecov/patch

platform_plugin_aspects/management/commands/load_test_tracking_events.py#L51

Added line #L51 was not covered by tests

Expand All @@ -76,17 +73,18 @@ def __init__(self, num_users: int, username_prefix: str):
)

log.info(f"Created course {self.course.id}")
self.create_and_enroll_learners(num_users, username_prefix)

Check warning on line 76 in platform_plugin_aspects/management/commands/load_test_tracking_events.py

View check run for this annotation

Codecov / codecov/patch

platform_plugin_aspects/management/commands/load_test_tracking_events.py#L75-L76

Added lines #L75 - L76 were not covered by tests

def create_and_enroll_learners(self, num_users, username_prefix):
log.info(f"Creating {num_users} users prefixed with {username_prefix}.")

Check warning on line 79 in platform_plugin_aspects/management/commands/load_test_tracking_events.py

View check run for this annotation

Codecov / codecov/patch

platform_plugin_aspects/management/commands/load_test_tracking_events.py#L78-L79

Added lines #L78 - L79 were not covered by tests

for _ in range(num_users):
user_short_name = str(uuid.uuid4())[:6]
u = self.create_user(

Check warning on line 83 in platform_plugin_aspects/management/commands/load_test_tracking_events.py

View check run for this annotation

Codecov / codecov/patch

platform_plugin_aspects/management/commands/load_test_tracking_events.py#L82-L83

Added lines #L82 - L83 were not covered by tests
username=f"learner_{user_short_name}",
username=f"{username_prefix}_{user_short_name}",
name=f"Learner {user_short_name}",
password="aspects",
email=f"{user_short_name}@openedx.invalid",
is_active=True
)
self.users.append(u)
e = CourseEnrollment.get_or_create_enrollment(user=u, course_key=self.course.id)
Expand Down

0 comments on commit e045aa3

Please sign in to comment.