File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -23,11 +23,19 @@ def test_model_can_create_a_bucketlist(self):
2323 new_count = Bucketlist .objects .count ()
2424 self .assertNotEqual (old_count , new_count )
2525
26+ def test_is_owner_enforcement (self ):
27+ """Test that the api has authorization."""
28+ new_user = User .objects .create (username = "aaa" )
29+ bucketlist = Bucketlist .objects .filter (owner = new_user )
30+ self .assertEquals (bucketlist .count (), 0 )
31+
2632 def test_model_returns_readable_representation (self ):
2733 """Test a readable string is returned for the model instance."""
2834 self .assertEqual (str (self .bucketlist ), self .name )
2935
3036
37+
38+
3139class ViewTestCase (TestCase ):
3240 """Test suite for the api views."""
3341
@@ -77,5 +85,4 @@ def test_api_can_delete_bucketlist(self):
7785 reverse ('details' , kwargs = {'pk' : bucketlist .id }),
7886 format = 'json' ,
7987 follow = True )
80-
8188 self .assertEquals (response .status_code , status .HTTP_204_NO_CONTENT )
You can’t perform that action at this time.
0 commit comments