Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AAP-31326: Add OrgName to the Marketing report #1304

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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",
manstis marked this conversation as resolved.
Show resolved Hide resolved
"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
Loading