Skip to content

Commit

Permalink
AAP-31326: Add OrgName to the Marketing report (#1304)
Browse files Browse the repository at this point in the history
  • Loading branch information
goneri authored Sep 16, 2024
1 parent 6b667d1 commit ba0feae
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ def test_dry_run(self):
with self.assertLogs(logger="root", level="INFO") as log:
out = TestGenerateUsersTrialsReports.call_command("--dry-run")
self.assertInLog("First name,Last name,Organization name,Plan name,Trial started", log)
self.assertInLog("First name,Last name,Email,Plan name,Trial started", log)
self.assertInLog(
"First name,Last name,Email,Organization name,Plan name,Trial started", log
)
self.assertIn("Reports not sent", out)

def test_auto_date_range(self):
Expand Down
2 changes: 2 additions & 0 deletions ansible_ai_connect/users/reports/generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ def generate(
"First name",
"Last name",
"Email",
"Organization name",
"Plan name",
"Trial started",
"Trial expired_at",
Expand All @@ -140,6 +141,7 @@ def generate(
user["given_name"],
user["family_name"],
user["email"],
organization["name"],
plan["plan"]["name"],
plan["created_at"],
plan["expired_at"],
Expand Down
5 changes: 4 additions & 1 deletion ansible_ai_connect/users/reports/tests/test_generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,10 @@ def tearDown(self):
super().cleanup()

def get_report_header(self) -> str:
return "OrgId,UUID,First name,Last name,Email,Plan name,Trial started,Trial expired_at"
return (
"OrgId,UUID,First name,Last name,Email,Organization name,"
"Plan name,Trial started,Trial expired_at"
)

def get_report_generator(self) -> BaseGenerator:
return UserMarketingReportGenerator()
Expand Down

0 comments on commit ba0feae

Please sign in to comment.