Пример #1
0
    def setUp(self):
        TestCase.setUp(self)

        self.bogus_user = bogus_user = get_user_model().objects.get(
            username='******')
        self.bogus_user2 = bogus_user2 = get_user_model().objects.get(
            username='******')
        # start by resetting the feeds
        for u in [self.bogus_user, self.bogus_user2]:
            user_feed = feedly.get_user_feed(u.id)
            user_feed.delete()
            for name, feed in feedly.get_feeds(u.id).items():
                feed.delete()

        # login the user
        rf = RequestMock()
        self.rf = rf
        self.client = Client()
        self.auth_client = Client()
        self.auth_client2 = Client()
        auth_response = self.auth_client.login(
            username='******', password='******')
        self.assertTrue(auth_response)
        auth_response = self.auth_client2.login(
            username='******', password='******')
        self.assertTrue(auth_response)
Пример #2
0
    def setUp(self):
        TestCase.setUp(self)

        self.bogus_user = bogus_user = get_user_model().objects.get(
            username='******')
        self.bogus_user2 = bogus_user2 = get_user_model().objects.get(
            username='******')
        # start by resetting the feeds
        for u in [self.bogus_user, self.bogus_user2]:
            user_feed = feedly.get_user_feed(u.id)
            user_feed.delete()
            for name, feed in feedly.get_feeds(u.id).items():
                feed.delete()

        # login the user
        rf = RequestMock()
        self.rf = rf
        self.client = Client()
        self.auth_client = Client()
        self.auth_client2 = Client()
        auth_response = self.auth_client.login(
            username='******', password='******')
        self.assertTrue(auth_response)
        auth_response = self.auth_client2.login(
            username='******', password='******')
        self.assertTrue(auth_response)
Пример #3
0
 def setUp(self):
     TestCase.setUp(self)
     self.rule = RuleFactory()
     self.rule.active = False
     self.rule.save()
     self.date = datetime.date(2012, 10, 29)
     self.appointment = AppointmentFactory.create(calendar__car=self.rule.car,
                                                  calendar__timeslot=self.rule.timeslot)
Пример #4
0
 def setUp(self):
     TestCase.setUp(self)
     from core.models import Item
     print(Item.objects.all().count())
     self.client = Client()
     self.auth_client = Client()
     response = self.auth_client.login(username='******', password='******')
     self.assertTrue(response)
     self.admin = get_user_model().objects.get(username='******')
     self.bogus = get_user_model().objects.get(username='******')
Пример #5
0
 def setUp(self):
     TestCase.setUp(self)
     from core.models import Item
     print(Item.objects.all().count())
     self.client = Client()
     self.auth_client = Client()
     response = self.auth_client.login(username='******', password='******')
     self.assertTrue(response)
     self.admin = get_user_model().objects.get(username='******')
     self.bogus = get_user_model().objects.get(username='******')
Пример #6
0
 def setUp(self):
     TestCase.setUp(self)
     self.instance = DataToTestEditCampaignControl.instance
     self.validate_data = DataToTestEditCampaignControl.validate_data.copy()
     self.rule_dict = DataToTestEditCampaignControl.rule_dict.copy()
     self.form_data = DataToTestEditCampaignControl.form_data[:]
     self.new_region = DataToTestEditCampaignControl.new_region[:]
     self.old_region = DataToTestEditCampaignControl.old_region.copy()
     self.list_1_to_compare_dict_lists = DataToTestEditCampaignControl.list_1_to_compare_dict_lists[:]
     self.list_2_to_compare_dict_lists = DataToTestEditCampaignControl.list_2_to_compare_dict_lists[:]
Пример #7
0
 def setUp(self):
     TestCase.setUp(self)
     self.car = CarFactory()
     self.timeslot = TimeSlotFactory()
     self.rule = RuleFactory(car=self.car, timeslot=self.timeslot)
     self.appointment = AppointmentFactory.create(
         calendar__car=self.car,
         calendar__timeslot=self.timeslot,
         kind=KIND_DELIVERY,
         weight=1)
     self.date = datetime.date(2012, 10, 29)
Пример #8
0
 def setUp(self):
     TestCase.setUp(self)
     self.car = CarFactory()
     self.region = RegionFactory()
     self.timeslot = TimeSlotFactory()
     self.rule = RuleFactory(car=self.car, timeslot=self.timeslot, region=self.region)
     self.appointment = AppointmentFactory.create(
         calendar__car=self.car,
         calendar__timeslot=self.timeslot)
     self.date = datetime.date(2012, 10, 29)
     self.other_date = datetime.date(2012, 10, 30)
Пример #9
0
 def setUp(self):
     TestCase.setUp(self)
     self.user = User.objects.create_superuser('eytan', '*****@*****.**', 'test')
     login_successful = self.client.login(username="******",password="******")
     self.assertTrue(login_successful)
Пример #10
0
 def setUp(self):
     TestCase.setUp(self)
     self.pk = self.model.objects.create(**self.data).pk
Пример #11
0
 def setUp(self):
     TestCase.setUp(self)
Пример #12
0
 def setUp(self):
     TestCase.setUp(self)
Пример #13
0
 def setUp(self):
     TestCase.setUp(self)
     self.sett = self.settings(**SETTINGS)
     self.sett.enable()
     assert self.client.login(username='******', password='******')
Пример #14
0
 def setUp(self):
     TestCase.setUp(self)
     self.rule = RuleFactory()
Пример #15
0
 def setUp(self):
     TestCase.setUp(self)
     self.rule = RuleFactory()
     self.date = datetime.date(2012, 10, 29)