File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 88from django .core .exceptions import ValidationError
99from django .core .management import call_command
1010from django .db import IntegrityError
11+ from psycopg .errors import ExclusionViolation
1112from rest_framework import status
1213
1314from desecapi .models import BlockedSubnet , Domain , RR , RRset
1819class UnauthenticatedRRSetTestCase (DesecTestCase ):
1920 def test_unique_record_in_rrset (self ):
2021 domain = self .create_domain ()
21- with self .assertRaises (IntegrityError ):
22+ with self .assertRaises (IntegrityError ) as cm :
2223 RRset .objects .create (
2324 domain = domain ,
2425 subname = "foo" ,
2526 type = "A" ,
26- ttl = 300 ,
27+ ttl = 3600 ,
2728 contents = ["1.2.3.4" ] * 2 ,
2829 )
30+ self .assertIsInstance (cm .exception .__cause__ , ExclusionViolation )
2931
3032 def test_unauthorized_access (self ):
3133 url = self .reverse ("v1:rrsets" , name = "example.com" )
You can’t perform that action at this time.
0 commit comments