Exemple #1
0
 def setUp(self):
     super(TestMailTask, self).setUp()
     self.user = fixtures.create_user()
     self.client = self.app.test_client()
     self.testbed = test_utils.create_testbed()
     self.taskq = self.testbed.get_stub(testbed.TASKQUEUE_SERVICE_NAME)
     self.mail_stub = self.testbed.get_stub(testbed.MAIL_SERVICE_NAME)
Exemple #2
0
 def setUp(self):
     super(TestUserSettings, self).setUp()
     self.testbed = test_utils.create_testbed()
     self.user = models.User.create(username='******',
                                    first_name='Test',
                                    last_name=u'Юзер',
                                    email='*****@*****.**')
Exemple #3
0
 def setUp(self):
     self.client = test.Client()
     self.testbed = test_utils.create_testbed()
     self.today = datetime.datetime(2015, 6, 12)
     self.loc_notif = ndb_models.LocationNotification.create(
         fixtures.LATLNG, 'testuser', u'Test Юзер',
         recipient_email='*****@*****.**', message=u'Привет')
Exemple #4
0
 def setUp(self):
     self.testbed = test_utils.create_testbed()
     self.user = auth_models.User.objects.create(username='******',
                                                 email='*****@*****.**',
                                                 first_name='Test',
                                                 last_name=u'Юзер')
     self.user_settings = models.UserSettings.objects.create(
         user=self.user, settings='{"email_subscription": true}')
Exemple #5
0
 def setUp(self):
     super(TestCleanupiOSDevicesTask, self).setUp()
     self.client = self.app.test_client()
     self.user = fixtures.create_user()
     self.testbed = test_utils.create_testbed()
     self.taskq = self.testbed.get_stub(testbed.TASKQUEUE_SERVICE_NAME)
     # Create devices
     device_params = [('12', api_args.ANDROID), ('23', api_args.IOS),
                      ('34', api_args.IOS)]
     self.devices = [
         models.Device.get_or_create(self.user, *param)
         for param in device_params
     ]
Exemple #6
0
 def setUp(self):
     super(GaeUtilsTest, self).setUp()
     self.client = self.app.test_client()
     self.user = fixtures.create_user()
     self.testbed = test_utils.create_testbed()
     self.taskq = self.testbed.get_stub(testbed.TASKQUEUE_SERVICE_NAME)
     self.mail_stub = self.testbed.get_stub(testbed.MAIL_SERVICE_NAME)
     # Create devices
     device_params = [('12', api_args.ANDROID), ('34', api_args.IOS)]
     for param in device_params:  # Both users own both devices
         models.Device.get_or_create(self.user, *param)
     self.payload_data = dict(title=u'Test Юзер',
                              message='sent you a new location',
                              type='notification',
                              id=123)
Exemple #7
0
 def setUp(self):
     self.client = test.Client()
     self.api_app = eucaby_app.create_app()
     self.api_app.config.from_object(test_base.Testing)
     self.api_client = self.api_app.test_client()
     self.testbed = test_utils.create_testbed()
     self.taskq = self.testbed.get_stub(testbed.TASKQUEUE_SERVICE_NAME)
     self.mail_stub = self.testbed.get_stub(testbed.MAIL_SERVICE_NAME)
     self.today = datetime.datetime(2015, 6, 12)
     self.loc_req = ndb_models.LocationRequest.create(
         'testuser', u'Test Юзер', recipient_email='*****@*****.**',
         message=u'Привет')
     self.user = auth_models.User.objects.create(
         username='******', email='*****@*****.**', first_name='Test',
         last_name=u'Юзер')
     self.user_settings = models.UserSettings.objects.create(
         user=self.user, settings='{"email_subscription": true}')