Skip to content

Commit 535bb88

Browse files
committed
test dummy
1 parent febfc43 commit 535bb88

File tree

2 files changed

+4
-30
lines changed

2 files changed

+4
-30
lines changed

test_app/tests/rbac/test_dummy_models.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,10 @@ def test_dummy_auditable_model_interface():
3636
assert test_obj.extra_related_fields(None) == {}
3737

3838

39-
def test_dummy_model_prevents_import_crashes():
40-
"""Test that DummyAuditableModel can be imported without activitystream app."""
41-
# This test verifies the import works (which it does if we got here)
42-
# The real test is that importing dummy_models doesn't crash AWX/EDA
39+
def test_dummy_model_import_safety():
40+
"""Test that DummyAuditableModel can be imported safely."""
41+
# The main purpose is that this import doesn't crash AWX/EDA
4342
from ansible_base.rbac.models.dummy_models import DummyAuditableModel
4443

45-
# Verify it's abstract
44+
# Basic verification that it's properly configured
4645
assert DummyAuditableModel._meta.abstract is True
47-
48-
# Verify expected interface exists
49-
dummy = DummyAuditableModel()
50-
assert hasattr(dummy, 'activity_stream_entries')
51-
assert hasattr(dummy, 'extra_related_fields')
52-
assert hasattr(dummy, 'activity_stream_excluded_field_names')
53-
assert hasattr(dummy, 'activity_stream_limit_field_names')

test_app/tests/rbac/test_rbac_activity_stream.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -127,21 +127,3 @@ def test_role_team_assignment_activity_stream(admin_user, team, organization):
127127
assert assignment_entries.count() == 2
128128
delete_entry = assignment_entries.last()
129129
verify_activity_entry_fields(delete_entry, 'delete', admin_user, team.id, role_def.id, 'team')
130-
131-
132-
@pytest.mark.skipif(not apps.is_installed('ansible_base.activitystream'), reason="Activity stream tests only run when activitystream app is installed")
133-
@pytest.mark.django_db
134-
def test_non_role_assignment_entry_str_unchanged(admin_user):
135-
"""Test that non-role assignment entries still use standard __str__() format."""
136-
from test_app.models import Organization
137-
138-
# Create a regular organization (not a role assignment)
139-
org = Organization.objects.create(name='TestOrg_Standard')
140-
141-
# Get the activity entry for the organization creation
142-
org_entry = org.activity_stream_entries.last()
143-
144-
# Verify it uses the standard format (not enhanced role assignment format)
145-
entry_str = str(org_entry)
146-
assert 'test_app | organization' in entry_str, "Non-role entries should use standard format"
147-
assert 'Role assignment' not in entry_str, "Non-role entries should not use role assignment format"

0 commit comments

Comments
 (0)