From 693a3d3ec63bcf3c0dc4831e68c9800e75019376 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Mon, 19 Nov 2012 23:58:09 +0100 Subject: [PATCH] models: Model creation with kwarg matching method name should fail --- tests/models_test.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/models_test.py b/tests/models_test.py index ed17cef3..218804e7 100644 --- a/tests/models_test.py +++ b/tests/models_test.py @@ -79,6 +79,13 @@ class ArtistTest(unittest.TestCase): test = lambda: Artist(foo='baz') self.assertRaises(TypeError, test) + def test_invalid_kwarg_with_name_matching_method(self): + test = lambda: Artist(copy='baz') + self.assertRaises(TypeError, test) + + test = lambda: Artist(serialize='baz') + self.assertRaises(TypeError, test) + def test_repr(self): self.assertEquals( "Artist(name=u'name', uri=u'uri')",