def test_suggestion_when_address_provided(self): Address.objects.create(user=self.user, address_line_one="12345 Test Ave") suggestions = Address.get_suggestion(self.user) self.assertEqual(len(suggestions), 1) suggestion = suggestions[0] self.assertEqual(suggestion["msg"], "Do you need to update your address from 12345 Test" + " Ave?") self.assertEqual(suggestion["priority"], 1)
def test_suggestion_when_address_blank(self): suggestions = Address.get_suggestion(self.user) self.assertEqual(len(suggestions), 1) suggestion = suggestions[0] self.assertEqual(suggestion["msg"], "Would you like to provide your address?") self.assertEqual(suggestion["priority"], 5)
def test_suggestion_when_address_blank(self): suggestions = Address.get_suggestion(self.user) self.assertEqual(len(suggestions), 1) suggestion = suggestions[0] self.assertEqual(suggestion['msg'], "Would you like to provide your address?") self.assertEqual(suggestion['priority'], 5)
def test_suggestion_when_address_provided(self): Address.objects.create(user=self.user, address_line_one="12345 Test Ave") suggestions = Address.get_suggestion(self.user) self.assertEqual(len(suggestions), 1) suggestion = suggestions[0] self.assertEqual( suggestion['msg'], "Do you need to update your address from 12345 Test" + " Ave?") self.assertEqual(suggestion['priority'], 1)