class Skill(models.Model): dev = models.ForeignKey(foreign_key="Developer") name = models.CharField(max_length=64) specialization = models.ArrayField(null=True, value_type="text", db_index=True) notes = models.TextField(null=True)
async def test_arrayfield_wrong_dimensions_size(self): with self.assertRaises(AsyncOrmFieldError) as exc: models.ArrayField().validate([["backend", "nodejs"], ["frontend"]]) self.assertEqual( exc.exception.args[0], "Multi-dimensional arrays must have items of the same size")
async def test_arrayfield_wrong_dimensions_type(self): with self.assertRaises(FieldError) as exc: models.ArrayField().validate([['backend', 'nodejs'], 'frontend']) self.assertEqual(exc.exception.args[0], 'Array elements are not of the same type')
async def test_arrayfield_wrong_dimensions_size(self): with self.assertRaises(FieldError) as exc: models.ArrayField().validate([['backend', 'nodejs'], ['frontend']]) self.assertEqual(exc.exception.args[0], 'Multi-dimensional arrays must have items of the same size')
async def test_arrayfield_wrong_dimensions_type(self): with self.assertRaises(AsyncOrmFieldError) as exc: models.ArrayField().validate([["backend", "nodejs"], "frontend"]) self.assertEqual(exc.exception.args[0], "Array elements are not of the same type")