Skip to content

Commit

Permalink
Fix field init tests. Thanks Josh Bohde
Browse files Browse the repository at this point in the history
  • Loading branch information
issackelly committed Aug 28, 2012
1 parent 7b37078 commit 179ab3f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/content_gfk/tests/fields.py
Expand Up @@ -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({
Expand Down

0 comments on commit 179ab3f

Please sign in to comment.