feat(org): add slug integration tests#161
Conversation
- test_create_organization_with_slug: verifies slug is set and returned on create - test_update_organization_with_slug: verifies slug can be updated via UpdateOrganization
WalkthroughTwo new test cases validate slug support in the organization API: one creates an organization with a unique slug and asserts the returned slug matches, the other creates an organization then updates its slug and verifies the change persists. ChangesOrganization slug validation tests
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/test_organization.py (1)
119-119: ⚡ Quick winMove the import statement to the module level.
The
import timestatement should be placed at the top of the file with other imports, following Python conventions (PEP 8). This applies to both test methods.♻️ Proposed fix
Add
timeimport at the top of the file (after line 3):from faker import Faker +import time from basetest import BaseTestThen remove the inline imports:
def test_create_organization_with_slug(self): """ Method to test create organization with slug """ - import time slug = f"test-slug-{int(time.time() * 1000)}"def test_update_organization_with_slug(self): """ Method to test update organization with slug """ - import time organization = CreateOrganization(display_name=Faker().company(), external_id=Faker().uuid4())🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/test_organization.py` at line 119, The file has inline "import time" statements inside test methods; move "import time" to the module-level imports at the top of the file (with the other imports) and remove the inline imports from the test functions (any functions named test_* in that file) so tests use the top-level time import per PEP 8.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@tests/test_organization.py`:
- Line 119: The file has inline "import time" statements inside test methods;
move "import time" to the module-level imports at the top of the file (with the
other imports) and remove the inline imports from the test functions (any
functions named test_* in that file) so tests use the top-level time import per
PEP 8.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 5805f09e-e62c-4d49-9e5a-266180ed5d3f
📒 Files selected for processing (1)
tests/test_organization.py
Summary
slugis already present in the generated proto types (CreateOrganization,UpdateOrganization,Organization)Test plan
test_create_organization_with_slug— sets slug onCreateOrganization, assertsresponse[0].organization.slugmatchestest_update_organization_with_slug— sets slug onUpdateOrganization, asserts updated value is returnedRun with staging credentials:
Summary by CodeRabbit