mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Further attempts to fix CI issues
This commit is contained in:
parent
4994920119
commit
99718865c0
@ -553,8 +553,7 @@ db_config['TEST'] = {
|
||||
|
||||
# Set collation option for mysql test database
|
||||
if 'mysql' in db_engine:
|
||||
# Ref: https://docs.djangoproject.com/en/4.0/ref/databases/#collation-settings
|
||||
db_config['TEST']['COLLATION'] = 'utf8_bin'
|
||||
db_config['TEST']['COLLATION'] = 'utf8_general_ci'
|
||||
|
||||
DATABASES = {
|
||||
'default': db_config
|
||||
|
@ -779,7 +779,7 @@ class Part(MPTTModel):
|
||||
|
||||
# Raise an error if an IPN is set, and it is a duplicate
|
||||
if self.IPN and not allow_duplicate_ipn:
|
||||
parts = Part.objects.filter(IPN=self.IPN)
|
||||
parts = Part.objects.filter(IPN__iexact=self.IPN)
|
||||
parts = parts.exclude(pk=self.pk)
|
||||
|
||||
if parts.exists():
|
||||
|
@ -352,10 +352,10 @@ class PartSettingsTest(TestCase):
|
||||
# Any duplicate IPN should raise an error
|
||||
Part.objects.create(name='xyz', revision='1', description='A part', IPN='UNIQUE')
|
||||
|
||||
# Case sensitive, so other variations don't error out:
|
||||
Part.objects.create(name='xyz', revision='2', description='A part', IPN='UNIQUe')
|
||||
Part.objects.create(name='xyz', revision='3', description='A part', IPN='UNIQuE')
|
||||
Part.objects.create(name='xyz', revision='4', description='A part', IPN='UNIqUE')
|
||||
# Case insensitive, so variations on spelling should throw an error
|
||||
for ipn in ['UNiquE', 'uniQuE', 'unique']:
|
||||
with self.assertRaises(ValidationError):
|
||||
Part.objects.create(name='xyz', revision='2', description='A part', IPN=ipn)
|
||||
|
||||
with self.assertRaises(ValidationError):
|
||||
Part.objects.create(name='zyx', description='A part', IPN='UNIQUE')
|
||||
|
Loading…
Reference in New Issue
Block a user