summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2017-02-24 16:54:10 +0100
committerTim Graham <timograham@gmail.com>2017-02-24 10:54:10 -0500
commitdc811cf50306972f838af8a975848ec26548bbf8 (patch)
treea4e8c88566eb5da34fdf1abb47e5a5f6ef6fcb30 /tests
parentc31e7ab5a4b062225bc4f6b5cae065325dd30f1f (diff)
Refs #22144 -- Added test for QuerySet.bulk_create() with long non-ASCII text.
Diffstat (limited to 'tests')
-rw-r--r--tests/bulk_create/models.py1
-rw-r--r--tests/bulk_create/tests.py10
2 files changed, 11 insertions, 0 deletions
diff --git a/tests/bulk_create/models.py b/tests/bulk_create/models.py
index b98ce4a152..c0ea527a62 100644
--- a/tests/bulk_create/models.py
+++ b/tests/bulk_create/models.py
@@ -14,6 +14,7 @@ except ImportError:
class Country(models.Model):
name = models.CharField(max_length=255)
iso_two_letter = models.CharField(max_length=2)
+ description = models.TextField()
class ProxyCountry(Country):
diff --git a/tests/bulk_create/tests.py b/tests/bulk_create/tests.py
index f401d4e32e..6b3e0bedc4 100644
--- a/tests/bulk_create/tests.py
+++ b/tests/bulk_create/tests.py
@@ -39,6 +39,16 @@ class BulkCreateTests(TestCase):
with self.assertNumQueries(1):
Country.objects.bulk_create(self.data)
+ @skipUnlessDBFeature('has_bulk_insert')
+ def test_long_non_ascii_text(self):
+ """
+ Inserting non-ASCII values with a length in the range 2001 to 4000
+ characters, i.e. 4002 to 8000 bytes, must be set as a CLOB on Oracle
+ (#22144).
+ """
+ Country.objects.bulk_create([Country(description='Ж' * 3000)])
+ self.assertEqual(Country.objects.count(), 1)
+
def test_multi_table_inheritance_unsupported(self):
expected_message = "Can't bulk create a multi-table inherited model"
with self.assertRaisesMessage(ValueError, expected_message):