示例#1
0
 def test_generate_privileged_app(self):
     appname = 'a test app'
     categories = ['books', 'music']
     app = generate_app_from_spec(appname,
                                  categories,
                                  'privileged',
                                  num_previews=3,
                                  num_ratings=4,
                                  num_locales=1,
                                  status='public',
                                  permissions=['storage'],
                                  versions=[{
                                      'status': 'public'
                                  }, {
                                      'status': 'disabled'
                                  }, {
                                      'status': 'public'
                                  }],
                                  description='test app')
     eq_(app.name, appname)
     eq_(app.categories, categories)
     eq_(app.status, 4)
     eq_(app.reload().total_reviews, 4)
     eq_(app.reviews.count(), 4)
     eq_(app.get_previews().count(), 3)
     eq_(app.versions.count(), 4)
     eq_(app.latest_version.version, '1.3')
示例#2
0
 def test_generate_hosted_app(self):
     appname = 'a test app'
     categories = ['books', 'music']
     app = generate_app_from_spec(
         appname, categories, 'hosted', num_previews=3,
         num_ratings=4, num_locales=1, status='public',
         description='test app')
     eq_(app.name, appname)
     eq_(app.categories, categories)
     eq_(app.status, 4)
     eq_(app.reload().total_reviews, 4)
     eq_(app.reviews.count(), 4)
     eq_(app.get_previews().count(), 3)
示例#3
0
 def test_generate_privileged_app(self):
     appname = 'a test app'
     categories = ['books', 'music']
     app = generate_app_from_spec(
         appname, categories, 'privileged', num_previews=3,
         num_ratings=4, num_locales=1, status='public',
         permissions=['storage'], versions=['public', 'disabled', 'public'],
         description='test app')
     eq_(app.name, appname)
     eq_(app.categories, categories)
     eq_(app.status, 4)
     eq_(app.reload().total_reviews, 4)
     eq_(app.reviews.count(), 4)
     eq_(app.get_previews().count(), 3)
     eq_(app.versions.count(), 3)
     eq_(app.latest_version.version, '1.2')
示例#4
0
 def test_generate_hosted_app(self):
     appname = 'a test app'
     categories = ['books', 'music']
     app = generate_app_from_spec(appname,
                                  categories,
                                  'hosted',
                                  num_previews=3,
                                  num_ratings=4,
                                  num_locales=1,
                                  status='public',
                                  description='test app')
     eq_(app.name, appname)
     eq_(app.categories, categories)
     eq_(app.status, 4)
     eq_(app.reload().total_reviews, 4)
     eq_(app.reviews.count(), 4)
     eq_(app.get_previews().count(), 3)