
from marshmallow.exceptions import ValidationError

class TestValidationError:

    def test_stores_message_in_list(self):
        err = ValidationError('foo')
        assert err.messages == ['foo']

    def test_can_pass_list_of_messages(self):
        err = ValidationError(['foo', 'bar'])
        assert err.messages == ['foo', 'bar']


from marshmallow.exceptions import ValidationError

class TestValidationError:

    def test_stores_message_in_list(self):
        err = ValidationError('foo')
        assert err.messages == ['foo']

    def test_can_pass_list_of_messages(self):
        err = ValidationError(['foo', 'bar'])
        assert err.messages == ['foo', 'bar']

    def test_stores_dictionaries(self):
        messages = {'user': {'email': ['email is invalid']}}
        err = ValidationError(messages)
        assert err.messages == messages

Add test for storing dictionaries on ValidationError
Add test for storing dictionaries on ValidationError

  
  from marshmallow.exceptions import ValidationError
  
  class TestValidationError:
  
      def test_stores_message_in_list(self):
          err = ValidationError('foo')
          assert err.messages == ['foo']
  
      def test_can_pass_list_of_messages(self):
          err = ValidationError(['foo', 'bar'])
          assert err.messages == ['foo', 'bar']
  
+     def test_stores_dictionaries(self):
+         messages = {'user': {'email': ['email is invalid']}}
+         err = ValidationError(messages)
+         assert err.messages == messages
+ 
Add test for storing dictionaries on ValidationError
## Code Before:

from marshmallow.exceptions import ValidationError

class TestValidationError:

    def test_stores_message_in_list(self):
        err = ValidationError('foo')
        assert err.messages == ['foo']

    def test_can_pass_list_of_messages(self):
        err = ValidationError(['foo', 'bar'])
        assert err.messages == ['foo', 'bar']

## Instruction:
Add test for storing dictionaries on ValidationError
## Code After:

from marshmallow.exceptions import ValidationError

class TestValidationError:

    def test_stores_message_in_list(self):
        err = ValidationError('foo')
        assert err.messages == ['foo']

    def test_can_pass_list_of_messages(self):
        err = ValidationError(['foo', 'bar'])
        assert err.messages == ['foo', 'bar']

    def test_stores_dictionaries(self):
        messages = {'user': {'email': ['email is invalid']}}
        err = ValidationError(messages)
        assert err.messages == messages
