Skip to content

Commit

Permalink
Merge 96e6cb5 into 3e6f3b2
Browse files Browse the repository at this point in the history
  • Loading branch information
Natim committed Jul 17, 2015
2 parents 3e6f3b2 + 96e6cb5 commit d0a8c22
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
4 changes: 2 additions & 2 deletions kinto/tests/support.py
Expand Up @@ -10,8 +10,8 @@
from kinto import DEFAULT_SETTINGS


MINIMALIST_BUCKET = {'data': dict()}
MINIMALIST_COLLECTION = {'data': dict()}
MINIMALIST_BUCKET = {}
MINIMALIST_COLLECTION = {}
MINIMALIST_GROUP = {'data': dict(members=['fxa:user'])}
MINIMALIST_RECORD = {'data': dict(name="Hulled Barley",
type="Whole Grain")}
Expand Down
6 changes: 2 additions & 4 deletions kinto/tests/test_views_buckets.py
Expand Up @@ -12,16 +12,14 @@ class BucketViewTest(BaseWebTest, unittest.TestCase):

def setUp(self):
super(BucketViewTest, self).setUp()
bucket = MINIMALIST_BUCKET.copy()
resp = self.app.put_json(self.record_url,
bucket,
MINIMALIST_BUCKET,
headers=self.headers)
self.record = resp.json['data']

def test_buckets_are_global_to_every_users(self):
self.app.patch_json(self.record_url,
{'data': {},
'permissions': {'read': [Authenticated]}},
{'permissions': {'read': [Authenticated]}},
headers=self.headers)
self.app.get(self.record_url, headers=get_user_headers('alice'))

Expand Down
15 changes: 11 additions & 4 deletions kinto/tests/test_views_groups.py
Expand Up @@ -161,7 +161,14 @@ def setUp(self):

def test_groups_must_have_members_attribute(self):
invalid = {}
self.app.put_json(self.group_url,
invalid,
headers=self.headers,
status=400)
resp = self.app.put_json(self.group_url,
invalid,
headers=self.headers,
status=400)
self.assertEqual(resp.json['message'],
"data is missing")
self.assertDictEqual(resp.json['details'][0], {
"description": "data is missing",
"location": "body",
"name": "data"
})
8 changes: 4 additions & 4 deletions loadtests/loadtest/tutorial.py
Expand Up @@ -139,21 +139,21 @@ def play_user_shared_bucket_tutorial(self):

# Create a new bucket and check for permissions
resp = self.session.put(
self.bucket_url(bucket_id),
data=json.dumps({'data': {}}))
self.bucket_url(bucket_id))
self.incr_counter("status-%s" % resp.status_code)
# We should always have a 201 here. See mozilla-services/cliquet#367
# if resp.status_code == 200:
# import pdb; pdb.set_trace()
# self.assertEqual(resp.status_code, 201)
record = resp.json()
print record
self.assertIn('write', record['permissions'])

# Create a new collection and check for permissions
permissions = {"record:create": ['system.Authenticated']}
resp = self.session.put(
re.sub('/records$', '', collection_url),
data=json.dumps({'data': {}, 'permissions': permissions}))
data=json.dumps({'permissions': permissions}))
self.incr_counter("status-%s" % resp.status_code)
# We should always have a 201 here. See mozilla-services/cliquet#367
# if resp.status_code == 200:
Expand Down Expand Up @@ -223,7 +223,7 @@ def play_user_shared_bucket_tutorial(self):
permissions = {"group:create": ['system.Authenticated']}
resp = self.session.put(
self.bucket_url(bucket_id),
data=json.dumps({'data': {}, 'permissions': permissions}))
data=json.dumps({'permissions': permissions}))
self.incr_counter("status-%s" % resp.status_code)
self.assertEqual(resp.status_code, 200)
record = resp.json()
Expand Down

0 comments on commit d0a8c22

Please sign in to comment.