Procházet zdrojové kódy

use TestCase.assertRaises instead of pytest.raises

master
Michael van Tellingen před 10 roky
rodič
revize
6439a956c2
1 změnil soubory, kde provedl 1 přidání a 2 odebrání
  1. 1
    2
      tests/unit/address/model_tests.py

+ 1
- 2
tests/unit/address/model_tests.py Zobrazit soubor

1
 # -*- coding: utf-8 -*-
1
 # -*- coding: utf-8 -*-
2
-import pytest
3
 from django.test import TestCase
2
 from django.test import TestCase
4
 from django.core import exceptions
3
 from django.core import exceptions
5
 
4
 
200
     country = models.Country(iso_3166_1_a2=country_value)
199
     country = models.Country(iso_3166_1_a2=country_value)
201
     address = models.UserAddress(country=country, postcode=postcode_value)
200
     address = models.UserAddress(country=country, postcode=postcode_value)
202
 
201
 
203
-    with pytest.raises(exceptions.ValidationError):
202
+    with self.assertRaises(exceptions.ValidationError):
204
         address.clean()
203
         address.clean()
205
 
204
 
206
 
205
 

Načítá se…
Zrušit
Uložit