示例#1
0
    def setUp(self):
        self.fixture = create_fixture()

        home = Location.objects.create()
        hunting_ground = Location.objects.create()
        self.cat = Cat.objects.create(
            name='foo',
            home=home,
            backup_home=hunting_ground
        )
        self.cat.hunting_grounds.add(hunting_ground)
示例#2
0
    def setUp(self):
        self.fixture = create_fixture()
        f = self.fixture
        f.users[0].favorite_pet = f.cats[0]
        f.users[0].save()

        f.users[1].favorite_pet = f.cats[1]
        f.users[1].save()

        f.users[2].favorite_pet = f.dogs[1]
        f.users[2].save()
示例#3
0
    def setUp(self):
        self.fixture = create_fixture()
        f = self.fixture
        f.users[0].favorite_pet = f.cats[0]
        f.users[0].save()

        f.users[1].favorite_pet = f.cats[1]
        f.users[1].save()

        f.users[2].favorite_pet = f.dogs[1]
        f.users[2].save()
示例#4
0
    def setUp(self):
        self.fixture = create_fixture()

        home = Location.objects.create()
        hunting_ground = Location.objects.create()
        self.cat = Cat.objects.create(
            name='foo',
            home=home,
            backup_home=hunting_ground
        )
        self.cat.hunting_grounds.add(hunting_ground)
示例#5
0
 def setUp(self):
     self.fixture = create_fixture()
     home_id = self.fixture.locations[0].id
     backup_home_id = self.fixture.locations[1].id
     parent = Cat.objects.create(
         name='Parent',
         home_id=home_id,
         backup_home_id=backup_home_id
     )
     self.kitten = Cat.objects.create(
         name='Kitten',
         home_id=home_id,
         backup_home_id=backup_home_id,
         parent=parent
     )
示例#6
0
 def setUp(self):
     self.fixture = create_fixture()
     home_id = self.fixture.locations[0].id
     backup_home_id = self.fixture.locations[1].id
     parent = Cat.objects.create(
         name='Parent',
         home_id=home_id,
         backup_home_id=backup_home_id
     )
     self.kitten = Cat.objects.create(
         name='Kitten',
         home_id=home_id,
         backup_home_id=backup_home_id,
         parent=parent
     )
示例#7
0
 def setUp(self):
     self.fixture = create_fixture()
     self.maxDiff = None
     self.default_user = User.objects.filter(
         manager__isnull=True,
         officer__isnull=True
     ).first()
     self.manager_user = User.objects.filter(
         manager__isnull=False
     ).first()
     self.officer_user = User.objects.filter(
         officer__isnull=False
     ).first()
     self.admin_user = User.objects.filter(
         is_superuser=True
     ).first()
示例#8
0
 def setUp(self):
     self.fixture = create_fixture()
     self.maxDiff = None
示例#9
0
 def setUp(self):
     self.fixture = create_fixture()
示例#10
0
 def setUp(self):
     self.fixture = create_fixture()
     self.maxDiff = None
示例#11
0
 def setUp(self):
     self.fixture = create_fixture()
     self.view = GroupNoMergeDictViewSet.as_view({'post': 'create'})
     self.rf = RequestFactory()
示例#12
0
 def setUp(self):
     self.fixture = create_fixture()
     self.rf = RequestFactory()
     self.view = DogViewSet.as_view({'patch': 'partial_update'})
示例#13
0
 def setUp(self):
     self.fixture = create_fixture()
 def setUp(self):
     self.fixture = create_fixture()
     self.drest = DRESTClient('test', client=MockSession(self.client))
    def handle(self, *args, **options):
        create_fixture()

        self.stdout.write("Loaded fixtures.")
示例#16
0
 def setUp(self):
     self.fixture = create_fixture()
     self.ids = [i.pk for i in self.fixture.dogs]
     self.ids_to_delete = self.ids[:2]
示例#17
0
 def setUp(self):
     self.fixture = create_fixture()
     self.view = GroupNoMergeDictViewSet.as_view({'post': 'create'})
     self.rf = RequestFactory()