def get_notifications(self): for sql_location in self.get_sql_locations(): products = self.get_sql_products_list(sql_location) for user in self.get_users(sql_location): message = self.get_message(sql_location.name, user, products) if message: yield Notification(self.domain, user, message)
def get_notifications(self): for sql_location in self.get_sql_locations(): message = self.get_message(sql_location) if not message: continue for user in self.get_users(sql_location): yield Notification(self.domain, user, message)
def setUp(self): super(SMSNotificationTestCase, self).setUp() self.district = make_loc('test-district', 'Test District', self.TEST_DOMAIN, 'district') self.user = bootstrap_web_user( username='******', domain=self.TEST_DOMAIN, phone_number='+4444', location=self.district, email='*****@*****.**', password='******' ) set_sms_notifications(self.domain, self.user, True) self.notification = Notification(self.TEST_DOMAIN, self.user, 'test')