@pytest.mark.django_db
def test_tp_empty_stats(project0_nongnu, project0, templates):
 language = LanguageDBFactory()
 tp = TranslationProject.objects.create(language=language, project=project0)
 tp.init_from_templates()
 assert (list(tp.stores.all()) == [])
 stats = tp.data_tool.get_stats()
 assert (stats['total'] == 0)
 assert (stats['translated'] == 0)
 assert (stats['fuzzy'] == 0)
 assert (stats['suggestions'] == 0)
 assert (stats['critical'] == 0)

@ pytest . mark . django_db def test_tp_empty_stats ( project0_nongnu , project0 , templates ) : language = LanguageDBFactory ( ) tp = TranslationProject . objects . create ( language = language , project = project0 ) tp . init_from_templates ( ) assert ( list ( tp . stores . all ( ) ) == [ ] ) stats = tp . data_tool . get_stats ( ) assert ( stats [ 'total' ] == 0 ) assert ( stats [ 'translated' ] == 0 ) assert ( stats [ 'fuzzy' ] == 0 ) assert ( stats [ 'suggestions' ] == 0 ) assert ( stats [ 'critical' ] == 0 )
tests if empty stats is initialized when translation project is added for a project with existing but empty template translation project .