diff options
author | Hasan Ramezani <hasan.r67@gmail.com> | 2020-12-10 18:00:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-10 18:00:57 +0100 |
commit | 275dd4ebbabbbe758c7219a3d666953d5a7b072f (patch) | |
tree | d0534f7047f9ba43525368eda2c121df54801d4c /tests/model_fields | |
parent | 5ce31d6a7142ca8c76d6b52fa42b3406b9a8ff48 (diff) | |
download | django-275dd4ebbabbbe758c7219a3d666953d5a7b072f.tar.gz |
Fixed #32178 -- Allowed database backends to skip tests and mark expected failures.
Co-authored-by: Tim Graham <timograham@gmail.com>
Diffstat (limited to 'tests/model_fields')
-rw-r--r-- | tests/model_fields/test_charfield.py | 5 | ||||
-rw-r--r-- | tests/model_fields/test_decimalfield.py | 4 | ||||
-rw-r--r-- | tests/model_fields/test_integerfield.py | 3 | ||||
-rw-r--r-- | tests/model_fields/test_jsonfield.py | 6 | ||||
-rw-r--r-- | tests/model_fields/test_textfield.py | 5 |
5 files changed, 4 insertions, 19 deletions
diff --git a/tests/model_fields/test_charfield.py b/tests/model_fields/test_charfield.py index 0e6109c860..17c230c776 100644 --- a/tests/model_fields/test_charfield.py +++ b/tests/model_fields/test_charfield.py @@ -1,7 +1,5 @@ -from unittest import skipIf - from django.core.exceptions import ValidationError -from django.db import connection, models +from django.db import models from django.test import SimpleTestCase, TestCase from .models import Post @@ -22,7 +20,6 @@ class TestCharField(TestCase): def test_lookup_integer_in_charfield(self): self.assertEqual(Post.objects.filter(title=9).count(), 0) - @skipIf(connection.vendor == 'mysql', 'Running on MySQL requires utf8mb4 encoding (#18392)') def test_emoji(self): p = Post.objects.create(title='Smile 😀', body='Whatever.') p.refresh_from_db() diff --git a/tests/model_fields/test_decimalfield.py b/tests/model_fields/test_decimalfield.py index 729b5e570a..2d96cfd437 100644 --- a/tests/model_fields/test_decimalfield.py +++ b/tests/model_fields/test_decimalfield.py @@ -1,9 +1,8 @@ -import unittest from decimal import Decimal from django.core import validators from django.core.exceptions import ValidationError -from django.db import connection, models +from django.db import models from django.test import TestCase from .models import BigD, Foo @@ -66,7 +65,6 @@ class DecimalFieldTests(TestCase): bd = BigD.objects.get(pk=bd.pk) self.assertEqual(bd.d, Decimal('12.9')) - @unittest.skipIf(connection.vendor == 'sqlite', 'SQLite stores values rounded to 15 significant digits.') def test_fetch_from_db_without_float_rounding(self): big_decimal = BigD.objects.create(d=Decimal('.100000000000000000000000000005')) big_decimal.refresh_from_db() diff --git a/tests/model_fields/test_integerfield.py b/tests/model_fields/test_integerfield.py index 13b18d967c..af5a9f2e35 100644 --- a/tests/model_fields/test_integerfield.py +++ b/tests/model_fields/test_integerfield.py @@ -1,5 +1,3 @@ -import unittest - from django.core import validators from django.core.exceptions import ValidationError from django.db import IntegrityError, connection, models @@ -192,7 +190,6 @@ class PositiveIntegerFieldTests(IntegerFieldTests): else models.IntegerField ) - @unittest.skipIf(connection.vendor == 'sqlite', "SQLite doesn't have a constraint.") def test_negative_values(self): p = PositiveIntegerModel.objects.create(value=0) p.value = models.F('value') - 1 diff --git a/tests/model_fields/test_jsonfield.py b/tests/model_fields/test_jsonfield.py index 321826814b..f71efcff61 100644 --- a/tests/model_fields/test_jsonfield.py +++ b/tests/model_fields/test_jsonfield.py @@ -1,6 +1,6 @@ import operator import uuid -from unittest import mock, skipIf +from unittest import mock from django import forms from django.core import serializers @@ -719,10 +719,6 @@ class TestQuerying(TestCase): objs_with_value, ) - @skipIf( - connection.vendor == 'oracle', - 'Raises ORA-00600: internal error code on Oracle 18.', - ) def test_usage_in_subquery(self): self.assertSequenceEqual( NullableJSONModel.objects.filter( diff --git a/tests/model_fields/test_textfield.py b/tests/model_fields/test_textfield.py index f0bce822a4..dd5f5a5280 100644 --- a/tests/model_fields/test_textfield.py +++ b/tests/model_fields/test_textfield.py @@ -1,7 +1,5 @@ -from unittest import skipIf - from django import forms -from django.db import connection, models +from django.db import models from django.test import SimpleTestCase, TestCase from .models import Post @@ -32,7 +30,6 @@ class TextFieldTests(TestCase): def test_lookup_integer_in_textfield(self): self.assertEqual(Post.objects.filter(body=24).count(), 0) - @skipIf(connection.vendor == 'mysql', 'Running on MySQL requires utf8mb4 encoding (#18392)') def test_emoji(self): p = Post.objects.create(title='Whatever', body='Smile 😀.') p.refresh_from_db() |