Skip to content

Commit db48e91

Browse files
committed
Get parent_uuid with the help of uuid from _create_gist response in UT
1 parent db8ff63 commit db48e91

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

desktop/core/src/desktop/api2_tests.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -708,15 +708,17 @@ def test_multiple_gist_dirs_on_gist_create(self):
708708

709709
assert_equal(2, Directory.objects.filter(name=Document2.GIST_DIR, type='directory').count())
710710

711+
# get_gist_directory merges all duplicate gist directories into one
711712
response = self._create_gist(
712713
statement='SELECT 12345',
713714
doc_type='hive-query',
714715
name='test_gist_create',
715716
)
716-
gist_parent_dir = Document2.objects.get(type='gist', name='test_gist_create').parent_directory
717+
gist_uuid = json.loads(response.content)['uuid']
718+
gist_parent_uuid = Document2.objects.get(uuid=gist_uuid).parent_directory.uuid
717719

718720
assert_equal(1, Directory.objects.filter(name=Document2.GIST_DIR, type='directory').count())
719-
assert_true(Directory.objects.filter(name=Document2.GIST_DIR, type='directory', uuid=gist_parent_dir.uuid).exists())
721+
assert_true(Directory.objects.filter(name=Document2.GIST_DIR, type='directory', uuid=gist_parent_uuid).exists())
720722

721723

722724
def test_get(self):

0 commit comments

Comments
 (0)