@pytest.mark.django_db
def test_get_children(project0, language0):
 def _all_children_are_directories_or_stores(item):
  for child in item.children:
   if isinstance(child, Directory):
    _all_children_are_directories_or_stores(child)
   else:
    assert isinstance(child, Store)
 for tp in project0.children:
  assert isinstance(tp, TranslationProject)
  _all_children_are_directories_or_stores(tp)
 for tp in language0.children:
  assert isinstance(tp, TranslationProject)
  _all_children_are_directories_or_stores(tp)

@ pytest . mark . django_db def test_get_children ( project0 , language0 ) : def _all_children_are_directories_or_stores ( item ) : for child in item . children : if isinstance ( child , Directory ) : _all_children_are_directories_or_stores ( child ) else : assert isinstance ( child , Store ) for tp in project0 . children : assert isinstance ( tp , TranslationProject ) _all_children_are_directories_or_stores ( tp ) for tp in language0 . children : assert isinstance ( tp , TranslationProject ) _all_children_are_directories_or_stores ( tp )
ensure that retrieved child objects have a correct type .