コード例 #1
0
ファイル: test_models.py プロジェクト: hello-base/web
    def test_participants(self):
        single = SingleFactory()
        groups = [GroupFactory() for i in xrange(3)]
        single.groups.add(*groups)
        single.save()

        edition = EditionFactory(single=single)
        assert len(edition.participants()) == 3
コード例 #2
0
ファイル: test_models.py プロジェクト: hello-base/web
 def test_get_primary_edition(self):
     single = SingleFactory()
     edition1 = EditionFactory(single=single, kind=edition_type.regular)
     edition2 = EditionFactory(single=single, kind=edition_type.limited)
     assert edition2._get_primary_edition() == edition1
コード例 #3
0
ファイル: test_models.py プロジェクト: hello-base/web
 def test_get_absolute_url(self, client):
     single = SingleFactory()
     edition = EditionFactory(single=single)
     response = client.get(edition.get_absolute_url())
     assert edition.get_absolute_url() == single.get_absolute_url()
     assert response.status_code == 200