Reset warnings before testing warnings

pull/2442/head
Tim Heap 2016-04-04 12:19:59 +10:00 zatwierdzone przez Karl Hobley
rodzic a6e53abd34
commit a48ae09ce9
1 zmienionych plików z 4 dodań i 0 usunięć

Wyświetl plik

@ -11,6 +11,8 @@ from wagtail.utils.deprecation import RemovedInWagtail17Warning, SearchFieldsSho
class TestThisShouldBeAList(SimpleTestCase):
def test_add_a_list(self):
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter('always')
base = SearchFieldsShouldBeAList(['hello'])
result = base + ['world']
@ -23,6 +25,8 @@ class TestThisShouldBeAList(SimpleTestCase):
def test_add_a_tuple(self):
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter('always')
base = SearchFieldsShouldBeAList(['hello'])
result = base + ('world',)