def test__campaign_name_bigger_than_50__error(self):
     # Act
     serializer = CampaignSerializer(
         data=JsonObjects.campaign(name=self.NAME_WITH_51_CHARACTERS))
     serializer.is_valid()
     # Assert
     self.assertEqual(self.ERRO_NAME_BIGGER_THAN_50, str(serializer.errors[Field.NAME]))
 def test__create_campaign_with_begin_date_bigger_than_end_date__false(self):
     # Arrange
     data = JsonObjects.campaign(begin_date="2055-09-04T19:13:40Z")
     # Act
     serializer = CampaignSerializer(data=data)
     is_true = serializer.is_valid()
     # Assert
     self.assertFalse(is_true)
 def test__active_campaign__not_null(self):
     # Act
     serializer = CampaignSerializer(data=JsonObjects.campaign(active=None))
     serializer.is_valid()
     self.assertEqual(self.ERROR_NOT_NULL, str(serializer.errors[Field.ACTIVE]))
 def test__campaign_name__null(self):
     # Act
     serializer = CampaignSerializer(data=JsonObjects.campaign(name=None))
     serializer.is_valid()
     # Assert
     self.assertEqual(self.ERROR_NOT_NULL, str(serializer.errors[Field.NAME]))
 def test__active_campaign__invalid_type(self):
     # Act
     serializer = CampaignSerializer(data=JsonObjects.campaign(active="Active"))
     serializer.is_valid()
     # Assert
     self.assertEqual(self.ERROR_INVALID_TYPE_ACTIVE_FIELD, str(serializer.errors[Field.ACTIVE]))