@@ -705,8 +705,15 @@ def test_multiple_gist_dirs_on_gist_create(self):
705
705
706
706
gist_dir1 = Directory .objects .create (name = Document2 .GIST_DIR , owner = self .user , parent_directory = home_dir )
707
707
gist_dir2 = Directory .objects .create (name = Document2 .GIST_DIR , owner = self .user , parent_directory = home_dir )
708
+ gist_child = Document2 .objects .create (
709
+ name = 'test_gist_child' ,
710
+ data = json .dumps ({'statement' : 'SELECT 123' }),
711
+ owner = self .user ,
712
+ type = 'gist' ,
713
+ parent_directory = gist_dir2 ,
714
+ )
708
715
709
- assert_equal (2 , Directory .objects .filter (name = Document2 .GIST_DIR , type = 'directory' ).count ())
716
+ assert_equal (2 , Directory .objects .filter (name = Document2 .GIST_DIR , type = 'directory' , owner = self . user ).count ())
710
717
711
718
# get_gist_directory merges all duplicate gist directories into one
712
719
response = self ._create_gist (
@@ -715,11 +722,12 @@ def test_multiple_gist_dirs_on_gist_create(self):
715
722
name = 'test_gist_create' ,
716
723
)
717
724
gist_uuid = json .loads (response .content )['uuid' ]
718
- gist_parent_uuid = Document2 .objects .get (uuid = gist_uuid ).parent_directory . uuid
725
+ gist_home = Document2 .objects .get (uuid = gist_uuid ).parent_directory
719
726
720
- assert_equal (1 , Directory .objects .filter (name = Document2 .GIST_DIR , type = 'directory' ).count ())
721
- assert_true (Directory .objects .filter (name = Document2 .GIST_DIR , type = 'directory' , uuid = gist_parent_uuid ).exists ())
722
- assert_equal (gist_dir1 .uuid , Directory .objects .get (name = Document2 .GIST_DIR , type = 'directory' , parent_directory = home_dir ).uuid )
727
+ assert_equal (1 , Directory .objects .filter (name = Document2 .GIST_DIR , type = 'directory' , owner = self .user ).count ())
728
+ assert_true (Directory .objects .filter (name = Document2 .GIST_DIR , type = 'directory' , uuid = gist_home .uuid ).exists ())
729
+ assert_equal (gist_dir1 .uuid , gist_home .uuid )
730
+ assert_equal (Document2 .objects .get (name = 'test_gist_child' , type = 'gist' , owner = self .user ).parent_directory , gist_home )
723
731
724
732
725
733
def test_get (self ):
0 commit comments