mirror of
https://github.com/ansible/awx.git
synced 2026-03-20 18:37:39 -02:30
mock activity stream license and make query more specific
This commit is contained in:
@@ -133,6 +133,7 @@ def test_stream_queryset_hides_shows_items(
|
|||||||
assert queryset.filter(notification_template__pk=notification_template.pk, operation='create').count() == 1
|
assert queryset.filter(notification_template__pk=notification_template.pk, operation='create').count() == 1
|
||||||
|
|
||||||
@pytest.mark.django_db
|
@pytest.mark.django_db
|
||||||
|
@mock.patch('awx.api.views.feature_enabled', new=mock_feature_enabled)
|
||||||
def test_stream_user_direct_role_updates(get, post, organization_factory):
|
def test_stream_user_direct_role_updates(get, post, organization_factory):
|
||||||
objects = organization_factory('test_org',
|
objects = organization_factory('test_org',
|
||||||
superusers=['admin'],
|
superusers=['admin'],
|
||||||
@@ -144,7 +145,8 @@ def test_stream_user_direct_role_updates(get, post, organization_factory):
|
|||||||
|
|
||||||
activity_stream = ActivityStream.objects.filter(
|
activity_stream = ActivityStream.objects.filter(
|
||||||
inventory__pk=objects.inventories.inv1.pk,
|
inventory__pk=objects.inventories.inv1.pk,
|
||||||
user__pk=objects.users.test.pk).first()
|
user__pk=objects.users.test.pk,
|
||||||
|
role__pk=objects.inventories.inv1.read_role.pk).first()
|
||||||
url = reverse('api:activity_stream_detail', args=(activity_stream.pk,))
|
url = reverse('api:activity_stream_detail', args=(activity_stream.pk,))
|
||||||
response = get(url, objects.users.test)
|
response = get(url, objects.users.test)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user