Skip to content

Instantly share code, notes, and snippets.

@dmishe
Created August 20, 2009 11:15
Show Gist options
  • Save dmishe/170993 to your computer and use it in GitHub Desktop.
Save dmishe/170993 to your computer and use it in GitHub Desktop.
class TestSlugs(TestCase):
# This slug must be unique
b = BookPublisher(slug=self.slug)
self.assertRaises(IntegrityError, b.save)
#check if there's only one BookPublisher
self.assertEquals(BookPublisher.objects.count(), 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment