Permalink
Browse files

Fix field init tests. Thanks Josh Bohde

  • Loading branch information...
1 parent 7b37078 commit 179ab3fb279dbc6d9b9f75db9195606a22aebdca @issackelly issackelly committed Aug 28, 2012
Showing with 6 additions and 5 deletions.
  1. +6 −5 tests/content_gfk/tests/fields.py
@@ -9,16 +9,17 @@
class ContentTypeFieldTestCase(TestCase):
def test_init(self):
+ # Test that you have to use a dict some other resources
with self.assertRaises(ValueError):
- # Test that you have to use a dict some other resources
GenericForeignKeyField(((Note, NoteResource)), 'nofield')
- # Test that you must register some other resources
+ # Test that you must register some other resources
+ with self.assertRaises(ValueError):
GenericForeignKeyField({}, 'nofield')
- # Test that the resources you raise must be models
- GenericForeignKeyField({'str': 'ing'}, 'nofield')
-
+ # Test that the resources you raise must be models
+ with self.assertRaises(ValueError):
+ GenericForeignKeyField({NoteResource: Note}, 'nofield')
def test_get_related_resource(self):
gfk_field = GenericForeignKeyField({

0 comments on commit 179ab3f

Please sign in to comment.