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)
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)
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='******')
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[:]
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)
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)
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)
def setUp(self): TestCase.setUp(self) self.pk = self.model.objects.create(**self.data).pk
def setUp(self): TestCase.setUp(self)
def setUp(self): TestCase.setUp(self) self.sett = self.settings(**SETTINGS) self.sett.enable() assert self.client.login(username='******', password='******')
def setUp(self): TestCase.setUp(self) self.rule = RuleFactory()
def setUp(self): TestCase.setUp(self) self.rule = RuleFactory() self.date = datetime.date(2012, 10, 29)