Commit 35672bd3 authored by Michal Čihař's avatar Michal Čihař

Test translation.update_stats with no data

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 89c4007f
......@@ -30,9 +30,9 @@ from django.core.exceptions import ValidationError
import shutil
import os
from weblate.trans.models import (
Project, SubProject, Unit, WhiteboardMessage, Check, get_related_units,
Project, SubProject, Source, Unit, WhiteboardMessage, Check,
get_related_units,
)
from weblate.trans.models.source import Source
from weblate import appsettings
from weblate.trans.tests import OverrideSettings
from weblate.trans.tests.utils import get_test_file
......@@ -733,6 +733,16 @@ class TranslationTest(RepoTestCase):
translation = project.translation_set.get(language_code='cs')
translation.full_clean()
def test_update_stats(self):
"""
Check update stats with no units.
"""
project = self.create_subproject()
translation = project.translation_set.get(language_code='cs')
translation.update_stats()
translation.unit_set.all().delete()
translation.update_stats()
class WhiteboardMessageTest(TestCase):
"""Test(s) for WhiteboardMessage model."""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment