示例#1
0
    def test_search_objects(self):
        #community = TestFactory.createCommunity()
        #user1 = TestFactory.createUserOne(community)
        #user2 = TestFactory.createUserTwo(community)
        #shed = TestFactory.createShed(user1, community)
        tool = TestFactory.createTool()

        # Create a new request
        request = HTTPRequestSearch()

        # A user searches for "Hamm". Hammer should come up.
        request.user = tool.owner
        request.GET['q'] = "Hamm"

        # Search and make sure the response has a "Hammer" result.
        resp = search_objects(request)
        self.assertContains("Hammer", resp.content.decode("utf-8"))
示例#2
0
 def setUp(self):
     TestFactory.setUpAll()
示例#3
0
文件: tests.py 项目: jvd33/ToolShare
 def setUp(self):
     testfactory = TestFactory()
     testfactory.setUpAll()