Moving the messages endpoint to something more generic, and making the get visible all the time.
This commit is contained in:
parent
42ed8522fd
commit
8e5dc8d3db
7 changed files with 120 additions and 105 deletions
|
@ -65,8 +65,8 @@ from endpoints.api.permission import (RepositoryUserPermission, RepositoryTeamPe
|
|||
RepositoryTeamPermissionList, RepositoryUserPermissionList)
|
||||
from endpoints.api.superuser import (SuperUserLogs, SuperUserList, SuperUserManagement,
|
||||
SuperUserServiceKeyManagement, SuperUserServiceKey,
|
||||
SuperUserServiceKeyApproval, SuperUserTakeOwnership,
|
||||
SuperUserMessages, SuperUserMessage)
|
||||
SuperUserServiceKeyApproval, SuperUserTakeOwnership,)
|
||||
from endpoints.api.globalmessages import (GlobalUserMessage, GlobalUserMessages,)
|
||||
from endpoints.api.secscan import RepositoryImageSecurity
|
||||
from endpoints.api.suconfig import (SuperUserRegistryStatus, SuperUserConfig, SuperUserConfigFile,
|
||||
SuperUserCreateInitialSuperUser)
|
||||
|
@ -4283,9 +4283,9 @@ class TestSuperUserManagement(ApiTestCase):
|
|||
self.login(ADMIN_ACCESS_USER)
|
||||
|
||||
# Create a message
|
||||
self.postResponse(SuperUserMessages, data=dict(message={"content": "new message"}), expected_code=201)
|
||||
self.postResponse(GlobalUserMessages, data=dict(message={"content": "new message"}), expected_code=201)
|
||||
|
||||
json = self.getJsonResponse(SuperUserMessages)
|
||||
json = self.getJsonResponse(GlobalUserMessages)
|
||||
|
||||
self.assertEquals(len(json['messages']), 2)
|
||||
self.assertEquals(json['messages'][1]["content"], "new message")
|
||||
|
@ -4294,10 +4294,10 @@ class TestSuperUserManagement(ApiTestCase):
|
|||
|
||||
def test_delete_message(self):
|
||||
self.login(ADMIN_ACCESS_USER)
|
||||
json = self.getJsonResponse(SuperUserMessages)
|
||||
self.deleteResponse(SuperUserMessage, {"uuid": json['messages'][0]['uuid']}, 204)
|
||||
json = self.getJsonResponse(GlobalUserMessages)
|
||||
self.deleteResponse(GlobalUserMessage, {"uuid": json['messages'][0]['uuid']}, 204)
|
||||
|
||||
json = self.getJsonResponse(SuperUserMessages)
|
||||
json = self.getJsonResponse(GlobalUserMessages)
|
||||
|
||||
self.assertEquals(len(json['messages']), 0)
|
||||
|
||||
|
|
Reference in a new issue