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')
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")
class TestDetail(amo.tests.TestCase): def setUp(self): self.webapp = Webapp(name='woo', app_slug='yeah') self.webapp.save() def test_more_url(self): response = self.client.get(self.webapp.get_url_path()) eq_(pq(response.content)('#more-webpage').attr('data-more-url'), self.webapp.get_url_path(more=True))
def test_app_slug_blocklist(self): BlacklistedSlug.objects.create(name='slug') w = Webapp(app_slug='slug') w.save() eq_(w.app_slug, 'slug~')
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')
def test_webapp_type(self): webapp = Webapp() webapp.save() eq_(webapp.type, amo.ADDON_WEBAPP)
class WebappTest(amo.tests.TestCase): def setUp(self): self.webapp = Webapp(name="woo", app_slug="yeah") self.webapp.save() self.url = self.webapp.get_url_path()