Exemple #1
0
    def test_speccypl_author(self):
        gasman = Releaser.objects.get(name='Gasman')

        link = ReleaserExternalLink(releaser=gasman)
        link.url = 'http://speccy.pl/archive/author.php?id=24'
        self.assertEqual(link.link_class, 'SpeccyPlAuthor')
        self.assertEqual(link.parameter, 24)
Exemple #2
0
 def test_save_external_link_form_with_commit(self):
     releaser = Releaser.objects.create(name='Gasman', is_group=False)
     external_link = ReleaserExternalLink(releaser=releaser)
     form = ReleaserExternalLinkForm({'url': 'https://demozoo.org'}, instance=external_link)
     self.assertTrue(form.is_valid())
     form.save()
     self.assertEqual(releaser.external_links.count(), 1)
Exemple #3
0
    def test_artcity_artist(self):
        gasman = Releaser.objects.get(name='Gasman')

        link = ReleaserExternalLink(releaser=gasman)
        link.url = 'http://artcity.bitfellas.org/index.php?a=artist&id=42'
        self.assertEqual(link.link_class, 'ArtcityArtist')
        self.assertEqual(link.parameter, 42)

        # 'a' query param must be present
        link = ReleaserExternalLink(releaser=gasman)
        link.url = 'http://artcity.bitfellas.org/index.php?x=artist&id=42'
        self.assertEqual(link.link_class, 'BaseUrl')
        self.assertEqual(
            link.parameter,
            'http://artcity.bitfellas.org/index.php?x=artist&id=42')

        # 'a' query param must be the expected value for the link type ('artist')
        link = ReleaserExternalLink(releaser=gasman)
        link.url = 'http://artcity.bitfellas.org/index.php?a=artichoke&id=42'
        self.assertEqual(link.link_class, 'BaseUrl')
        self.assertEqual(
            link.parameter,
            'http://artcity.bitfellas.org/index.php?a=artichoke&id=42')
Exemple #4
0
    def test_pouet_group_id_must_be_numeric(self):
        gasman = Releaser.objects.get(name='Gasman')

        link = ReleaserExternalLink(releaser=gasman)
        link.url = 'https://www.pouet.net/groups.php?which=123'
        self.assertEqual(link.link_class, 'PouetGroup')
        self.assertEqual(link.parameter, 123)

        link = ReleaserExternalLink(releaser=gasman)
        link.url = 'https://www.pouet.net/groups.php?which=amigaaaa'
        self.assertEqual(link.link_class, 'BaseUrl')
        self.assertEqual(link.parameter,
                         'https://www.pouet.net/groups.php?which=amigaaaa')
Exemple #5
0
    def test_atariki_entry(self):
        pondlife = Production.objects.get(title='Pondlife')
        link = ProductionLink(production=pondlife, is_download_link=False)

        link.url = 'http://atariki.krap.pl/index.php/Cool_Emotion'
        self.assertEqual(link.link_class, 'AtarikiEntry')
        self.assertEqual(str(link.link),
                         'http://atariki.krap.pl/index.php/Cool_Emotion')

        gasman = Releaser.objects.get(name='Gasman')
        link = ReleaserExternalLink(releaser=gasman)

        link.url = 'http://atariki.krap.pl/index.php/Ars'
        self.assertEqual(link.link_class, 'AtarikiEntry')

        forever2e3 = Party.objects.get(name='Forever 2e3')
        link = PartyExternalLink(party=forever2e3)
        link.url = 'http://atariki.krap.pl/index.php/Lato_Ludzik%C3%B3w_1999'
        self.assertEqual(link.link_class, 'AtarikiEntry')
Exemple #6
0
 def test_empty_link(self):
     rel = ReleaserExternalLink()
     rel.url = None
     self.assertEqual(rel.link_class, None)
     self.assertEqual(rel.parameter, None)