Esempio n. 1
0
 def test_user_add_project(self):
     user_create('charlie', 'secret')
     api.project_create('acme-corp')
     user_add_project('charlie', 'acme-corp')
     user = api._must_find(User, 'charlie')
     project = api._must_find(model.Project, 'acme-corp')
     assert project in user.projects
     assert user in project.users
Esempio n. 2
0
 def test_user_add_project(self):
     user_create('charlie', 'secret')
     api.project_create('acme-corp')
     user_add_project('charlie', 'acme-corp')
     user = api._must_find(User, 'charlie')
     project = api._must_find(model.Project, 'acme-corp')
     assert project in user.projects
     assert user in project.users
Esempio n. 3
0
 def test_duplicate_user_add_project(self):
     user_create('charlie', 'secret')
     api.project_create('acme-corp')
     user_add_project('charlie', 'acme-corp')
     with pytest.raises(api.DuplicateError):
         user_add_project('charlie', 'acme-corp')
Esempio n. 4
0
 def test_duplicate_user_add_project(self):
     user_create('charlie', 'secret')
     api.project_create('acme-corp')
     user_add_project('charlie', 'acme-corp')
     with pytest.raises(api.DuplicateError):
         user_add_project('charlie', 'acme-corp')