예제 #1
0
class TestCatalogItemLookup(TestCase):
    def setUp(self):
        super(TestCatalogItemLookup, self).setUp()
        self.lookup = CatalogItemLookup()
        for i in range(5):
            CatalogItemFactory()

    def test_item_code(self):
        item = CatalogItemFactory(item_code='hello world')
        qs = self.lookup.get_query(None, 'hello')
        self.assertEqual(len(qs), 1)
        self.assertEqual(qs.get(), item)

    def test_description(self):
        item = CatalogItemFactory(description='hello world')
        qs = self.lookup.get_query(None, 'hello')
        self.assertEqual(len(qs), 1)
        self.assertEqual(qs.get(), item)
예제 #2
0
class TestCatalogItemLookup(TestCase):

    def setUp(self):
        super(TestCatalogItemLookup, self).setUp()
        self.lookup = CatalogItemLookup()
        for i in range(5):
            CatalogItemFactory()

    def test_item_code(self):
        item = CatalogItemFactory(item_code='hello world')
        qs = self.lookup.get_query(None, 'hello')
        self.assertEqual(len(qs), 1)
        self.assertEqual(qs.get(), item)

    def test_description(self):
        item = CatalogItemFactory(description='hello world')
        qs = self.lookup.get_query(None, 'hello')
        self.assertEqual(len(qs), 1)
        self.assertEqual(qs.get(), item)
예제 #3
0
 def setUp(self):
     super(TestCatalogItemLookup, self).setUp()
     self.lookup = CatalogItemLookup()
     for i in range(5):
         CatalogItemFactory()
예제 #4
0
 def setUp(self):
     super(TestCatalogItemLookup, self).setUp()
     self.lookup = CatalogItemLookup()
     for i in range(5):
         CatalogItemFactory()