# Path: nosedjangotests/polls/models.py
# class Poll(models.Model):
#     question = models.CharField(max_length=200)
#     pub_date = models.DateTimeField('date published')
# 
#     @atomic
#     def reset(self):
#         self.question = ""
#         self.save()
# 
# class Choice(models.Model):
#     content_type = models.ForeignKey('contenttypes.ContentType')
#     object_id = models.PositiveIntegerField()
#     poll = GenericForeignKey('content_type', 'object_id')
# 
#     choice = models.CharField(max_length=200)
#     votes = models.IntegerField(default=0)
# 
#     @atomic
#     def reset(self):
#         self.votes = 0
#         self.save()


import datetime
from unittest import TestCase as UnitTestCase
from nose.plugins.skip import SkipTest
from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType
from django.test import TestCase
from nosedjangotests.polls.models import Poll, Choice
                getattr(ct_db, attr), getattr(content_type, attr))


def _test_permissions(self):
    perm_types = ['add', 'change', 'delete']
    models = [(Poll, 'poll'), (Choice, 'choice')]

    for model, name in models:
        for perm_type in perm_types:
            codename = '%s_%s' % (perm_type, name)
            content_type = ContentType.objects.get_for_model(model)
            num_perms = Permission.objects.filter(
                codename=codename, content_type=content_type).count()
            self.assertEqual(num_perms, 1)


def _test_fixtures_1(self):
    num_polls = Poll.objects.all().count()
    self.assertEqual(num_polls, 1)

    bear_poll = Poll.objects.get(pk=1)
    self.assertEqual(bear_poll.question, 'What bear is best?')

    new_poll = Poll.objects.create(
        question="Did my shoes come off in the plane crash?",
        pub_date=datetime.datetime.now())
    new_poll.save()


def _test_fixtures_2(self):

# Path: nosedjangotests/polls/models.py
# class Poll(models.Model):
#     question = models.CharField(max_length=200)
#     pub_date = models.DateTimeField('date published')
# 
#     @atomic
#     def reset(self):
#         self.question = ""
#         self.save()
# 
# class Choice(models.Model):
#     content_type = models.ForeignKey('contenttypes.ContentType')
#     object_id = models.PositiveIntegerField()
#     poll = GenericForeignKey('content_type', 'object_id')
# 
#     choice = models.CharField(max_length=200)
#     votes = models.IntegerField(default=0)
# 
#     @atomic
#     def reset(self):
#         self.votes = 0
#         self.save()


# Path: nosedjangotests/polls/tests/test1.py
import datetime
from unittest import TestCase as UnitTestCase
from nose.plugins.skip import SkipTest
from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType
from django.test import TestCase
from nosedjangotests.polls.models import Poll, Choice

                getattr(ct_db, attr), getattr(content_type, attr))


def _test_permissions(self):
    perm_types = ['add', 'change', 'delete']
    models = [(Poll, 'poll'), (Choice, 'choice')]

    for model, name in models:
        for perm_type in perm_types:
            codename = '%s_%s' % (perm_type, name)
            content_type = ContentType.objects.get_for_model(model)
            num_perms = Permission.objects.filter(
                codename=codename, content_type=content_type).count()
            self.assertEqual(num_perms, 1)


def _test_fixtures_1(self):
    num_polls = Poll.objects.all().count()
    self.assertEqual(num_polls, 1)

    bear_poll = Poll.objects.get(pk=1)
    self.assertEqual(bear_poll.question, 'What bear is best?')

    new_poll = Poll.objects.create(
        question="Did my shoes come off in the plane crash?",
        pub_date=datetime.datetime.now())
    new_poll.save()


def _test_fixtures_2(self):

    num_polls = Poll.objects.all().count()