Ejemplo n.º 1
0
	def test_send_mass_sms(self):
		from smsish.sms import get_sms_connection
		with get_sms_connection(settings.SMS_BACKEND) as connection:
			datatuple = (("Body", VALID_FROM_NUMBER, [VALID_TO_NUMBER]) for _ in range(10))
			numSent = send_mass_sms(datatuple, connection=connection)
			self.assertEqual(numSent, 10)
			self.assertEqual(len(mail.outbox), 0)
Ejemplo n.º 2
0
		def test_send_mass_sms(self):
			with captured_stdout() as stdout:
				datatuple = (("Body", VALID_FROM_NUMBER, [VALID_TO_NUMBER]) for _ in range(10))
				numSent = send_mass_sms(datatuple)
				self.assertEqual(numSent, 10)
				self.assertEqual(len(mail.outbox), 0)
				output = stdout.getvalue()
				self.assertTrue("Subject: None" in output)
				self.assertTrue("From: +15005550006" in output)
				self.assertTrue("To: +15005550006" in output)
				self.assertTrue("Body" in output)
Ejemplo n.º 3
0
	def test_send_mass_sms(self):
		messageSpec = ("Body", VALID_FROM_NUMBER, [VALID_TO_NUMBER])
		datatuple = (messageSpec for _ in range(10))
		numSent = send_mass_sms(datatuple)
		self.assertEqual(numSent, 10)
		self.assertEqual(len(mail.outbox), 0)