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 assertDictContainsSubset(self, a, b, *args): try: DjangoTestCase.assertDictContainsSubset(self, a, b, *args) except AttributeError: for key, value in a.items(): self.assertTrue(key in b) self.assertEqual(b[key], value)
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) 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) 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.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.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.pk = self.model.objects.create(**self.data).pk
def setUp(self): TestCase.setUp(self)
def assertIn(self, expected, source, *args): try: DjangoTestCase.assertIn(self, expected, source, *args) except AttributeError: self.assertTrue(expected in source)
def setUp(self): TestCase.setUp(self) self.rule = RuleFactory() self.date = datetime.date(2012, 10, 29)
def __init__(self): TestCase.__init__(self, methodName='stop')
def setUp(self): TestCase.setUp(self) self.rule = RuleFactory()
def setUp(self): TestCase.setUp(self) self.sett = self.settings(**SETTINGS) self.sett.enable() assert self.client.login(username='******', password='******')
def __init__(self, method_name): self.ciprofloxacin = None TestCase.__init__(self, method_name)
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 before_scenario(context, _): context.test = TestCase() context.test.setUpClass()
def tearDown(self): TestCase.tearDown(self) encerrar_lockdown()
def before_scenario(context, scenario): context.test = TestCase() context.test.setUpClass() use_fixture(django_test_case, context)