@pytest.mark.django_db
def test_get_parents(po_directory, project0, language0, tp0, store0, subdir0, no_vfolders):
 subdir_store = subdir0.child_stores.first()
 parents = subdir_store.get_parents()
 assert (len(parents) == 1)
 assert isinstance(parents[0], Directory)
 parents = store0.get_parents()
 assert (len(parents) == 1)
 assert isinstance(parents[0], TranslationProject)
 parents = tp0.get_parents()
 assert (len(parents) == 1)
 assert isinstance(parents[0], Project)
 parents = tp0.directory.get_parents()
 assert (len(parents) == 1)
 assert isinstance(parents[0], Project)
 parents = project0.directory.get_parents()
 assert (len(parents) == 0)
 parents = language0.directory.get_parents()
 assert (len(parents) == 0)

@ pytest . mark . django_db def test_get_parents ( po_directory , project0 , language0 , tp0 , store0 , subdir0 , no_vfolders ) : subdir_store = subdir0 . child_stores . first ( ) parents = subdir_store . get_parents ( ) assert ( len ( parents ) == 1 ) assert isinstance ( parents [ 0 ] , Directory ) parents = store0 . get_parents ( ) assert ( len ( parents ) == 1 ) assert isinstance ( parents [ 0 ] , TranslationProject ) parents = tp0 . get_parents ( ) assert ( len ( parents ) == 1 ) assert isinstance ( parents [ 0 ] , Project ) parents = tp0 . directory . get_parents ( ) assert ( len ( parents ) == 1 ) assert isinstance ( parents [ 0 ] , Project ) parents = project0 . directory . get_parents ( ) assert ( len ( parents ) == 0 ) parents = language0 . directory . get_parents ( ) assert ( len ( parents ) == 0 )
ensure that retrieved parent objects have a correct type .