def test_label_for_field(self):
        self.assertEquals(
            label_for_field("title", Article),
            "title"
        )
        self.assertEquals(
            label_for_field("title2", Article),
            "another name"
        )
        self.assertEquals(
            label_for_field("title2", Article, return_attr=True),
            ("another name", None)
        )

        self.assertEquals(
            label_for_field("__unicode__", Article),
            "article"
        )
        self.assertEquals(
            label_for_field("__str__", Article),
            "article"
        )

        self.assertRaises(
            AttributeError,
            lambda: label_for_field("unknown", Article)
        )

        def test_callable(obj):
            return "nothing"
        self.assertEquals(
            label_for_field(test_callable, Article),
            "Test callable"
        )
        self.assertEquals(
            label_for_field(test_callable, Article, return_attr=True),
            ("Test callable", test_callable)
        )

        self.assertEquals(
            label_for_field("test_from_model", Article),
            "Test from model"
        )
        self.assertEquals(
            label_for_field("test_from_model", Article, return_attr=True),
            ("Test from model", Article.test_from_model)
        )
        self.assertEquals(
            label_for_field("test_from_model_with_override", Article),
            "not What you Expect"
        )

        self.assertEquals(
            label_for_field(lambda x: "nothing", Article),
            "--"
        )

        class MockModelAdmin(object):
            def test_from_model(self, obj):
                return "nothing"
            test_from_model.short_description = "not Really the Model"

        self.assertEquals(
            label_for_field("test_from_model", Article, model_admin=MockModelAdmin),
            "not Really the Model"
        )
        self.assertEquals(
            label_for_field("test_from_model", Article,
                model_admin = MockModelAdmin,
                return_attr = True
            ),
            ("not Really the Model", MockModelAdmin.test_from_model)
        )
Checks if there exists a RewriteRule directive in vhost
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.2/tests/regressiontests/admin_util/tests.py/UtilTests.test_label_for_field--crossover with--dataset/ETHPy150Open letsencrypt/letsencrypt/certbot-apache/certbot_apache/configurator.py/ApacheConfigurator._is_rewrite_exists