Esempio n. 1
0
    def test_app_slug_collision(self):
        Webapp(app_slug='slug').save()
        w2 = Webapp(app_slug='slug')
        w2.save()
        eq_(w2.app_slug, 'slug-1')

        w3 = Webapp(app_slug='slug')
        w3.save()
        eq_(w3.app_slug, 'slug-2')
Esempio n. 2
0
 def can_be_purchased(self):
     assert Webapp(premium_type=True).can_be_purchased()
     assert not Webapp(premium_type=False).can_be_purchased()
Esempio n. 3
0
 def test_reviewed(self):
     assert not Webapp().is_unreviewed()
Esempio n. 4
0
 def test_get_origin(self):
     url = 'http://www.xx.com:4000/randompath/manifest.webapp'
     webapp = Webapp(manifest_url=url)
     eq_(webapp.origin, 'http://www.xx.com:4000')
Esempio n. 5
0
 def test_get_url_path_more(self):
     webapp = Webapp(app_slug='woo')
     eq_(webapp.get_url_path(more=True), '/en-US/apps/app/woo/more')
Esempio n. 6
0
 def test_get_url_path(self):
     webapp = Webapp(app_slug='woo')
     eq_(webapp.get_url_path(), '/en-US/apps/app/woo/')
Esempio n. 7
0
 def test_app_slug_blocklist(self):
     BlacklistedSlug.objects.create(name='slug')
     w = Webapp(app_slug='slug')
     w.save()
     eq_(w.app_slug, 'slug~')
Esempio n. 8
0
 def test_app_slugs_separate_from_addon_slugs(self):
     Addon.objects.create(type=1, slug='slug')
     webapp = Webapp(app_slug='slug')
     webapp.save()
     eq_(webapp.slug, 'app-%s' % webapp.id)
     eq_(webapp.app_slug, 'slug')
Esempio n. 9
0
 def test_webapp_type(self):
     webapp = Webapp()
     webapp.save()
     eq_(webapp.type, amo.ADDON_WEBAPP)