Skip to content

Commit

Permalink
fix: remove error msg check from test_decimal_precision_limit (#646)
Browse files Browse the repository at this point in the history
* fix: remove error msg check from test_decimal_precision_limit

* refactor: lint fixes
  • Loading branch information
vi3k6i5 committed Jun 15, 2021
1 parent 4050713 commit 9be15c0
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions tests/system/django_spanner/test_decimal.py
Expand Up @@ -7,7 +7,6 @@
from .models import Author, Number
from django.test import TransactionTestCase
from django.db import connection, ProgrammingError
from django.db.utils import IntegrityError
from decimal import Decimal
from tests.system.django_spanner.utils import (
setup_instance,
Expand Down Expand Up @@ -89,12 +88,10 @@ def test_decimal_precision_limit(self):
"""
num_val = Number(num=Decimal(1) / Decimal(3))
if USE_EMULATOR:
msg = "The NUMERIC type supports 38 digits of precision and 9 digits of scale."
with self.assertRaisesRegex(IntegrityError, msg):
with self.assertRaises(ValueError):
num_val.save()
else:
msg = "400 Invalid value for bind parameter a0: Expected NUMERIC."
with self.assertRaisesRegex(ProgrammingError, msg):
with self.assertRaisesRegex(ProgrammingError):
num_val.save()

def test_decimal_update(self):
Expand Down

0 comments on commit 9be15c0

Please sign in to comment.