from nose.tools import with_setup

from apps.convention.factories import (
    ContestFactory,
    ContestantFactory,
    PerformanceFactory,
)

from apps.convention.models import (
    Contest,
    Contestant,
    Performance,
)


def simple():
    contest = ContestFactory(
        year='2014',
        contest_level=Contest.INTERNATIONAL,
        contest_type=Contest.QUARTET,
    )

    contestant = ContestantFactory(
        name='Testifour',
    )

    PerformanceFactory(
        contest=contest,
        contestant=contestant,
    )


@with_setup(simple)
def test_simple_test_case():
    performance = Performance.objects.all()[0]
    assert performance.__unicode__() == 'Testifour, Finals'

@@ -1,12 +1,14 @@
+# 
 from nose.to
@@ -30,16 +30,18 @@
 _setup%0A%0A
+# 
 from app
@@ -64,32 +64,34 @@
 tories import (%0A
+# 
     ContestFacto
@@ -94,20 +94,22 @@
 actory,%0A
+#
     
+ 
 Contesta
@@ -119,16 +119,18 @@
 actory,%0A
+# 
     Perf
@@ -145,19 +145,23 @@
 actory,%0A
+# 
 )%0A%0A
+# 
 from app
@@ -189,16 +189,18 @@
 mport (%0A
+# 
     Cont
@@ -200,24 +200,26 @@
    Contest,%0A
+# 
     Contesta
@@ -218,24 +218,26 @@
 Contestant,%0A
+# 
     Performa
@@ -241,20 +241,96 @@
 rmance,%0A
+# 
 )%0A%0A
-%0A
+# from factory.fuzzy import (%0A#     FuzzyText,%0A#     FuzzyInteger,%0A# )%0A%0A%0A# 
 def simp
@@ -331,24 +331,26 @@
 f simple():%0A
+# 
     contest 
@@ -359,32 +359,34 @@
 ContestFactory(%0A
+# 
         year='20
@@ -390,16 +390,18 @@
 '2014',%0A
+# 
         
@@ -437,24 +437,25 @@
 TIONAL,%0A
+#
         
 contest_
@@ -438,32 +438,33 @@
 IONAL,%0A#        
+ 
 contest_type=Con
@@ -477,23 +477,27 @@
 UARTET,%0A
+# 
     )%0A%0A
+# 
     cont
@@ -524,24 +524,25 @@
 actory(%0A
+#
         
 name='Te
@@ -533,16 +533,17 @@
         
+ 
 name='Te
@@ -556,19 +556,23 @@
 r',%0A
+# 
     )%0A%0A
+#
     
+ 
 Perf
@@ -587,16 +587,18 @@
 actory(%0A
+# 
         
@@ -614,16 +614,18 @@
 ontest,%0A
+# 
         
@@ -651,16 +651,18 @@
 nt,%0A
+# 
     )%0A%0A%0A
 @wit
@@ -657,16 +657,18 @@
     )%0A%0A%0A
+# 
 @with_se
@@ -679,16 +679,18 @@
 simple)%0A
+# 
 def test
@@ -710,16 +710,18 @@
 case():%0A
+# 
     perf
@@ -759,20 +759,22 @@
 ll()%5B0%5D%0A
+#
     
+ 
 assert p
@@ -821,8 +821,752 @@
 Finals'%0A
+%0A%0A# def build_contest(contest):%0A#     contest = ContestFactory(%0A#         year='2000',%0A#         contest_level=Contest.INTERNATIONAL,%0A#         contest_type=Contest.SENIOR,%0A#     )%0A%0A#     contestants = Contestant.objects.filter(%0A#         performances__contest=contest%0A#     )%0A#     for contestant in contestants:%0A#         PerformanceFactory(%0A#             contest=contest,%0A#             contestant=contestant,%0A#             song1=FuzzyText(),%0A#             mus1=FuzzyInteger(400, 500),%0A#             prs1=FuzzyInteger(400, 500),%0A#             sng1=FuzzyInteger(400, 500),%0A#             song2=FuzzyText(),%0A#             mus2=FuzzyInteger(400, 500),%0A#             prs2=FuzzyInteger(400, 500),%0A#             sng2=FuzzyInteger(400, 500),%0A#     )%0A

Disable tests -- should not have included them in bad state.