def challenge_setup():
    """Set up some sample data to test with.
    
    This is a bit clearer and hopefully more flexible than using fixtures.
    
    """
    challenge_teardown()  # In case other tests didn't clean up
    
    p = Project()
    p.name = 'My Project'
    p.slug = getattr(settings, 'IGNITE_PROJECT_SLUG', 'my-project')
    p.description = 'My super awesome project of awesomeness.'
    p.long_description = 'Did I mention how awesome it was?'
    p.allow_participation = True
    p.save()
    
    c = Challenge()
    c.project = p
    c.title, 'My Challenge'
    c.slug = getattr(settings, 'IGNITE_CHALLENGE_SLUG', 'my-challenge')
    c.summary = 'Are you up to it?'
    c.description = 'This is a challenge of supreme challengingness.'
    c.end_date = datetime.utcnow() + timedelta(days=365)
    c.save()
    
    ph = Phase()
    ph.challenge = c
    ph.name = 'Ideation'
    ph.order = 1
    ph.save()

    cat = Category()
    cat.name = 'Beer'
    cat.slug = 'beer'
    cat.save()
def challenge_setup():
    """Set up some sample data to test with.
    
    This is a bit clearer and hopefully more flexible than using fixtures.
    
    """
    challenge_teardown()  # In case other tests didn't clean up

    p = Project()
    p.name = 'My Project'
    p.slug = getattr(settings, 'IGNITE_PROJECT_SLUG', 'my-project')
    p.description = 'My super awesome project of awesomeness.'
    p.long_description = 'Did I mention how awesome it was?'
    p.allow_participation = True
    p.save()

    c = Challenge()
    c.project = p
    c.title, 'My Challenge'
    c.slug = getattr(settings, 'IGNITE_CHALLENGE_SLUG', 'my-challenge')
    c.summary = 'Are you up to it?'
    c.description = 'This is a challenge of supreme challengingness.'
    c.end_date = datetime.utcnow() + timedelta(days=365)
    c.save()

    ph = Phase()
    ph.challenge = c
    ph.name = 'Ideation'
    ph.order = 1
    ph.save()

    cat = Category()
    cat.name = 'Beer'
    cat.slug = 'beer'
    cat.save()