~jcsackett/charmworld/bac-tag-constraints

« back to all changes in this revision

Viewing changes to charmworld/views/tests/test_api.py

  • Committer: Tarmac
  • Author(s): Brad Crittenden
  • Date: 2013-08-01 20:59:27 UTC
  • mfrom: (325.1.9 bundle-search)
  • Revision ID: tarmac-20130801205927-lcbxxxb2bba92akt
[r=abentley][bug=][author=bac] Provide support for bundles in searching. The display of search results in the web app still only shows charms.

Show diffs side-by-side

added added

removed removed

Lines of Context:
627
627
class TestAPIBundles:
628
628
 
629
629
    def makeBundle(self, *args, **kwargs):
630
 
        return factory.makeBundle(self.db, *args, **kwargs)
 
630
        bundle, _ = factory.makeBundle(self.db, *args, **kwargs)
 
631
        return bundle
631
632
 
632
633
    def test_default_bundle(self):
633
634
        bundle = self.makeBundle()
634
635
        expected = dict(
635
 
            name='hoopy',
 
636
            name=bundle.name,
636
637
            owner='',
637
 
            basket=None,
 
638
            basket=bundle.basket,
638
639
            inherits=None,
639
640
            series='precise',
640
641
            title='',
648
649
        self.assertEqual(expected, bundle._representation)
649
650
 
650
651
    def test_default_model_object(self):
651
 
        bundle = self.makeBundle()
652
 
        self.assertEqual('hoopy', bundle.name)
 
652
        bundle = self.makeBundle(name='jojo')
 
653
        self.assertEqual('jojo', bundle.name)
653
654
 
654
655
    def test_db_insert_and_retrieval(self):
655
656
        bundle = self.makeBundle(name='ant')