  
      def test_hash(self):
          # Value based on PK
          self.assertEqual(hash(Article(id=1)), hash(1))
          with self.assertRaises(TypeError):
              # No PK value -> unhashable (because save() would then change
              # hash)
              hash(Article())
  
      def test_delete_and_access_field(self):
 
</s> remove             with self.assertRaises(FieldError):
 </s> add             msg = "Unsupported lookup 'junk' for IntegerField or join on the field not permitted."
            with self.assertRaisesMessage(FieldError, msg): </s> remove         with self.assertRaises(ValueError):
 </s> add         msg = 'Trying to compare non-ordered queryset against more than one ordered values'
        with self.assertRaisesMessage(ValueError, msg): </s> remove         with self.assertRaises(ValueError):
 </s> add         msg = "The annotation 'book_contact_set' conflicts with a field on the model."
        with self.assertRaisesMessage(ValueError, msg): </s> remove         with self.assertRaises(TypeError):
 </s> add         with self.assertRaisesMessage(TypeError, msg): </s> remove         # Can't be instantiated
        with self.assertRaises(TypeError):
 </s> add         msg = "EmptyQuerySet can't be instantiated"
        with self.assertRaisesMessage(TypeError, msg):
        msg = 'Model instances without primary key value are unhashable'
        with self.assertRaisesMessage(TypeError, msg):
  
      def test_hash(self):
          # Value based on PK
          self.assertEqual(hash(Article(id=1)), hash(1))
        msg = 'Model instances without primary key value are unhashable'
        with self.assertRaisesMessage(TypeError, msg):
              # No PK value -> unhashable (because save() would then change
              # hash)
              hash(Article())
  
      def test_delete_and_access_field(self):
keep keep keep keep replace keep keep keep keep keep
 Used assertRaisesMessage() to test Django's error messages. 
tests/basic/tests.py