Example #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')
Example #2
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")
Example #3
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')
Example #4
0
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))
Example #5
0
 def test_app_slug_blocklist(self):
     BlacklistedSlug.objects.create(name='slug')
     w = Webapp(app_slug='slug')
     w.save()
     eq_(w.app_slug, 'slug~')
Example #6
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')
Example #7
0
 def test_webapp_type(self):
     webapp = Webapp()
     webapp.save()
     eq_(webapp.type, amo.ADDON_WEBAPP)
Example #8
0
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()
Example #9
0
 def test_app_slug_blocklist(self):
     BlacklistedSlug.objects.create(name='slug')
     w = Webapp(app_slug='slug')
     w.save()
     eq_(w.app_slug, 'slug~')
Example #10
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')
Example #11
0
 def test_webapp_type(self):
     webapp = Webapp()
     webapp.save()
     eq_(webapp.type, amo.ADDON_WEBAPP)