~jcsackett/charmworld/bac-tag-constraints

« back to all changes in this revision

Viewing changes to charmworld/tests/test_models.py

  • Committer: Tarmac
  • Author(s): Abel Deuring
  • Date: 2013-08-07 13:31:20 UTC
  • mfrom: (334.1.5 etags)
  • Revision ID: tarmac-20130807133120-euu4igaar08e89iy
[r=abentley][bug=][author=adeuring] Add an Etag header to the API response for charm details.

Show diffs side-by-side

added added

removed removed

Lines of Context:
609
609
        self.assertEqual(30, len(charm.changes_since(datetime(2013, 5, 1))))
610
610
        self.assertEqual(5, len(charm.changes_since(datetime(2013, 6, 26))))
611
611
 
 
612
    def test_hash(self):
 
613
        charm_data = factory.get_charm_json()
 
614
        self.assertFalse('hash' in charm_data)
 
615
        charm = Charm(charm_data)
 
616
        self.assertIs(None, charm.hash)
 
617
        charm_data['hash'] = 'whatever'
 
618
        charm = Charm(charm_data)
 
619
        self.assertEqual('whatever', charm.hash)
 
620
 
612
621
 
613
622
class TestUser(MongoTestBase):
614
623
    """Unit tests for our User object wrapping of the mongo dict."""