more tests working but scopes broken

This commit is contained in:
vabene1111
2021-03-10 19:46:08 +01:00
parent 4742056223
commit b9b7a125f0
7 changed files with 199 additions and 138 deletions

View File

@@ -10,16 +10,11 @@ from cookbook.models import Keyword, Space
@pytest.mark.django_db
def test_user_create(user_2, user_1):
r = user_1.post(reverse('api:keyword-list'), {'name': 'test', 'space': 1}, content_type='application/json')
def test_user_create(u1_s1,u1_s2):
r = u1_s1.post(reverse('api:keyword-list'), {'name': 'test', 'space': 1}, content_type='application/json')
response = json.loads(r.content)
assert r.status_code == 201
assert response['name'] == 'test'
print('DEEEEEBUUUUUGGGG')
print(user_1.get(reverse('view_test')).content)
print(user_2.get(reverse('view_test')).content)
print(user_2)
r = user_2.get(reverse('api:keyword-detail', args={response['id']}), content_type='application/json')
r = u1_s2.get(reverse('api:keyword-detail', args={response['id']}), content_type='application/json')
assert r.status_code == 404