Commit ef61a319 authored by Michal Čihař's avatar Michal Čihař

Clear cache before testing google backend

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 775d260d
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
import httpretty import httpretty
from django.test import TestCase from django.test import TestCase
from django.core.cache import cache
from weblate.trans.tests.test_views import ViewTestCase from weblate.trans.tests.test_views import ViewTestCase
from weblate.trans.models.unit import Unit from weblate.trans.models.unit import Unit
from weblate.trans.machine.dummy import DummyTranslation from weblate.trans.machine.dummy import DummyTranslation
...@@ -188,6 +189,7 @@ class MachineTranslationTest(TestCase): ...@@ -188,6 +189,7 @@ class MachineTranslationTest(TestCase):
@httpretty.activate @httpretty.activate
def test_google(self): def test_google(self):
cache.delete('%s-languages' % GoogleTranslation().mtid)
httpretty.register_uri( httpretty.register_uri(
httpretty.GET, httpretty.GET,
'https://www.googleapis.com/language/translate/v2/languages', 'https://www.googleapis.com/language/translate/v2/languages',
...@@ -204,6 +206,7 @@ class MachineTranslationTest(TestCase): ...@@ -204,6 +206,7 @@ class MachineTranslationTest(TestCase):
@httpretty.activate @httpretty.activate
def test_google_invalid(self): def test_google_invalid(self):
"""Test handling of server failure.""" """Test handling of server failure."""
cache.delete('%s-languages' % GoogleTranslation().mtid)
httpretty.register_uri( httpretty.register_uri(
httpretty.GET, httpretty.GET,
'https://www.googleapis.com/language/translate/v2/languages', 'https://www.googleapis.com/language/translate/v2/languages',
......
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