          self.assertEqual(rs.errors,
                           {'username': ['This field must be unique.']})
          data = {'username': 'new-username', 'email': 'new-email@example.com'}
          rs = RelatedModelSerializer(data=data)
          self.assertTrue(rs.is_valid())
  
      def test_value_error_treated_as_not_unique(self):
          serializer = UniquenessIntegerSerializer(data={'integer': 'abc'})
          assert serializer.is_valid()
  
 
</s> remove         self.assertFalse(rs.is_valid())
        self.assertEqual(rs.errors,
                         {'username': ['This field must be unique.']})
 </s> add         assert not rs.is_valid()
        assert rs.errors == {'username': ['This field must be unique.']} </s> remove         self.assertTrue(serializer.is_valid())
        self.assertEqual(serializer.validated_data, data)
 </s> add         assert serializer.is_valid()
        assert serializer.validated_data == data </s> remove         self.assertEqual(
            AnotherUniquenessModel._meta.get_field('code').validators, [])
 </s> add         assert AnotherUniquenessModel._meta.get_field('code').validators == [] </s> remove         self.assertEqual(
            AnotherUniquenessModel._meta.get_field('code').validators, [])
 </s> add         assert AnotherUniquenessModel._meta.get_field('code').validators == [] </s> remove         self.assertEqual(serializer.data, {'email': 'foo@example.com'})
 </s> add         assert serializer.data == {'email': 'foo@example.com'}
        assert rs.is_valid()
          self.assertEqual(rs.errors,
                           {'username': ['This field must be unique.']})
          data = {'username': 'new-username', 'email': 'new-email@example.com'}
          rs = RelatedModelSerializer(data=data)
        assert rs.is_valid()
  
      def test_value_error_treated_as_not_unique(self):
          serializer = UniquenessIntegerSerializer(data={'integer': 'abc'})
          assert serializer.is_valid()
  
keep keep keep keep replace keep keep keep keep keep
 converted validators and write_only_fields test to pytest style (#4697) 
tests/test_validators.py