示例#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
文件: tests.py 项目: bmaeser/Feedly
    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 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)
示例#4
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)
 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[:]
示例#6
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='******')
示例#7
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='******')
示例#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.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)
示例#10
0
 def setUp(self):
     TestCase.setUp(self)
     self.pk = self.model.objects.create(**self.data).pk
 def setUp(self):
     TestCase.setUp(self)
示例#12
0
 def setUp(self):
     TestCase.setUp(self)
示例#13
0
 def assertIn(self, expected, source, *args):
     try:
         DjangoTestCase.assertIn(self, expected, source, *args)
     except AttributeError:
         self.assertTrue(expected in source)
示例#14
0
 def setUp(self):
     TestCase.setUp(self)
     self.rule = RuleFactory()
     self.date = datetime.date(2012, 10, 29)
示例#15
0
 def __init__(self):
     TestCase.__init__(self, methodName='stop')
示例#16
0
 def setUp(self):
     TestCase.setUp(self)
     self.rule = RuleFactory()
示例#17
0
 def setUp(self):
     TestCase.setUp(self)
     self.sett = self.settings(**SETTINGS)
     self.sett.enable()
     assert self.client.login(username='******', password='******')
示例#18
0
 def __init__(self, method_name):
     self.ciprofloxacin = None
     TestCase.__init__(self, method_name)
示例#19
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)
示例#20
0
 def __init__(self):
     TestCase.__init__(self, methodName='stop')
示例#21
0
def before_scenario(context, _):
    context.test = TestCase()
    context.test.setUpClass()
示例#22
0
 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)