@@ -418,8 +418,8 @@ def test_get_invalid_raw_log(self):
418
418
class APITests (TestCase ):
419
419
fixtures = ['eric.json' , 'test_data.json' ]
420
420
421
- def test_make_project (self ):
422
- """Test that a superuser can use the API."""
421
+ def test_cant_make_project (self ):
422
+ """Test that a can't use the API to create projects ."""
423
423
post_data = {
424
424
'name' : 'awesome-project' ,
425
425
'repo' : 'https://github.com/ericholscher/django-kong.git' ,
@@ -430,16 +430,7 @@ def test_make_project(self):
430
430
content_type = 'application/json' ,
431
431
HTTP_AUTHORIZATION = 'Basic %s' % super_auth ,
432
432
)
433
- self .assertEqual (resp .status_code , 201 )
434
- self .assertEqual (resp ['location' ], '/api/v1/project/24/' )
435
- resp = self .client .get (
436
- '/api/v1/project/24/' ,
437
- data = {'format' : 'json' },
438
- HTTP_AUTHORIZATION = 'Basic %s' % eric_auth ,
439
- )
440
- self .assertEqual (resp .status_code , 200 )
441
- obj = json .loads (resp .content )
442
- self .assertEqual (obj ['slug' ], 'awesome-project' )
433
+ self .assertEqual (resp .status_code , status .HTTP_401_UNAUTHORIZED )
443
434
444
435
def test_user_doesnt_get_full_api_return (self ):
445
436
user_normal = get (User , is_staff = False )
0 commit comments