def test_string_representation(self): """ Basic __str__ testing """ post = Post.objects.create(title='my title', content='my text') hit_count = HitCount(content_object=post) self.assertEqual(hit_count.__str__(), 'Post title: my title')