Change method name to match refactored email.py

This commit is contained in:
Christopher Broderick 2023-07-23 06:44:05 +01:00
parent 0b9bfbcddd
commit 49813051bc

View File

@ -6,7 +6,7 @@ from django.test import TestCase
from django.test.client import Client
from django.urls import reverse
import email
from helpdesk.email import object_from_message
from helpdesk.email import extract_email_metadata
from helpdesk.models import CustomField, FollowUp, KBCategory, KBItem, Queue, Ticket, TicketCC
import logging
from urllib.parse import urlparse
@ -282,7 +282,7 @@ class EmailInteractionsTestCase(TestCase):
email_count = len(mail.outbox)
object_from_message(str(msg), self.queue_public, logger=logger)
extract_email_metadata(str(msg), self.queue_public, logger=logger)
followup = FollowUp.objects.get(message_id=message_id)
ticket = Ticket.objects.get(id=followup.ticket.id)
@ -314,7 +314,7 @@ class EmailInteractionsTestCase(TestCase):
email_count = len(mail.outbox)
object_from_message(str(msg), self.queue_public, logger=logger)
extract_email_metadata(str(msg), self.queue_public, logger=logger)
ticket = Ticket.objects.get(
title=self.ticket_data['title'], queue=self.queue_public, submitter_email=submitter_email)
@ -350,7 +350,7 @@ class EmailInteractionsTestCase(TestCase):
email_count = len(mail.outbox)
object_from_message(str(msg), self.queue_public, logger=logger)
extract_email_metadata(str(msg), self.queue_public, logger=logger)
followup = FollowUp.objects.get(message_id=message_id)
ticket = Ticket.objects.get(id=followup.ticket.id)
@ -397,7 +397,7 @@ class EmailInteractionsTestCase(TestCase):
email_count = len(mail.outbox)
object_from_message(str(msg), self.queue_public, logger=logger)
extract_email_metadata(str(msg), self.queue_public, logger=logger)
followup = FollowUp.objects.get(message_id=message_id)
ticket = Ticket.objects.get(id=followup.ticket.id)
@ -449,7 +449,7 @@ class EmailInteractionsTestCase(TestCase):
email_count = len(mail.outbox)
object_from_message(str(msg), self.queue_public, logger=logger)
extract_email_metadata(str(msg), self.queue_public, logger=logger)
followup = FollowUp.objects.get(message_id=message_id)
ticket = Ticket.objects.get(id=followup.ticket.id)
@ -495,7 +495,7 @@ class EmailInteractionsTestCase(TestCase):
email_count = len(mail.outbox)
object_from_message(str(msg), self.queue_public, logger=logger)
extract_email_metadata(str(msg), self.queue_public, logger=logger)
followup = FollowUp.objects.get(message_id=message_id)
ticket = Ticket.objects.get(id=followup.ticket.id)
@ -529,7 +529,7 @@ class EmailInteractionsTestCase(TestCase):
reply.__setitem__('Content-Type', 'text/plain;')
reply.set_payload(self.ticket_data['description'])
object_from_message(str(reply), self.queue_public, logger=logger)
extract_email_metadata(str(reply), self.queue_public, logger=logger)
followup = FollowUp.objects.get(message_id=message_id)
ticket = Ticket.objects.get(id=followup.ticket.id)
@ -585,7 +585,7 @@ class EmailInteractionsTestCase(TestCase):
email_count = len(mail.outbox)
object_from_message(str(msg), self.queue_public, logger=logger)
extract_email_metadata(str(msg), self.queue_public, logger=logger)
followup = FollowUp.objects.get(message_id=message_id)
ticket = Ticket.objects.get(id=followup.ticket.id)
@ -629,7 +629,7 @@ class EmailInteractionsTestCase(TestCase):
reply.__setitem__('Content-Type', 'text/plain;')
reply.set_payload(self.ticket_data['description'])
object_from_message(str(reply), self.queue_public, logger=logger)
extract_email_metadata(str(reply), self.queue_public, logger=logger)
followup = FollowUp.objects.get(message_id=message_id)
ticket = Ticket.objects.get(id=followup.ticket.id)
@ -683,7 +683,7 @@ class EmailInteractionsTestCase(TestCase):
email_count = len(mail.outbox)
object_from_message(str(msg), self.queue_public, logger=logger)
extract_email_metadata(str(msg), self.queue_public, logger=logger)
followup = FollowUp.objects.get(message_id=message_id)
ticket = Ticket.objects.get(id=followup.ticket.id)
@ -738,7 +738,7 @@ class EmailInteractionsTestCase(TestCase):
email_count = len(mail.outbox)
object_from_message(str(reply), self.queue_public, logger=logger)
extract_email_metadata(str(reply), self.queue_public, logger=logger)
followup = FollowUp.objects.get(message_id=message_id)
ticket = Ticket.objects.get(id=followup.ticket.id)
@ -780,7 +780,7 @@ class EmailInteractionsTestCase(TestCase):
msg.set_payload(self.ticket_data['description'])
email_count = len(mail.outbox)
object_from_message(str(msg), self.queue_public, logger=logger)
extract_email_metadata(str(msg), self.queue_public, logger=logger)
followup = FollowUp.objects.get(message_id=message_id)
ticket = Ticket.objects.get(id=followup.ticket.id)
@ -830,7 +830,7 @@ class EmailInteractionsTestCase(TestCase):
email_count = len(mail.outbox)
object_from_message(
extract_email_metadata(
str(msg), self.queue_public_with_notifications_disabled, logger=logger)
followup = FollowUp.objects.get(message_id=message_id)
@ -877,7 +877,7 @@ class EmailInteractionsTestCase(TestCase):
email_count = len(mail.outbox)
object_from_message(str(msg), self.queue_public, logger=logger)
extract_email_metadata(str(msg), self.queue_public, logger=logger)
followup = FollowUp.objects.get(message_id=message_id)
ticket = Ticket.objects.get(id=followup.ticket.id)
@ -915,7 +915,7 @@ class EmailInteractionsTestCase(TestCase):
reply.__setitem__('Content-Type', 'text/plain;')
reply.set_payload(self.ticket_data['description'])
object_from_message(str(reply), self.queue_public, logger=logger)
extract_email_metadata(str(reply), self.queue_public, logger=logger)
followup = FollowUp.objects.get(message_id=message_id)
ticket = Ticket.objects.get(id=followup.ticket.id)
@ -961,7 +961,7 @@ class EmailInteractionsTestCase(TestCase):
email_count = len(mail.outbox)
object_from_message(
extract_email_metadata(
str(msg), self.queue_public_with_notifications_disabled, logger=logger)
followup = FollowUp.objects.get(message_id=message_id)
@ -1000,7 +1000,7 @@ class EmailInteractionsTestCase(TestCase):
reply.__setitem__('Content-Type', 'text/plain;')
reply.set_payload(self.ticket_data['description'])
object_from_message(
extract_email_metadata(
str(reply), self.queue_public_with_notifications_disabled, logger=logger)
followup = FollowUp.objects.get(message_id=message_id)
@ -1034,7 +1034,7 @@ class EmailInteractionsTestCase(TestCase):
email_count = len(mail.outbox)
object_from_message(str(msg), self.queue_public, logger=logger)
extract_email_metadata(str(msg), self.queue_public, logger=logger)
followup = FollowUp.objects.get(message_id=message_id)
ticket = Ticket.objects.get(id=followup.ticket.id)
@ -1056,7 +1056,7 @@ class EmailInteractionsTestCase(TestCase):
reply.__setitem__('Content-Type', 'text/plain;')
reply.set_payload(self.ticket_data['description'])
object_from_message(str(reply), self.queue_public, logger=logger)
extract_email_metadata(str(reply), self.queue_public, logger=logger)
followup = FollowUp.objects.get(message_id=message_id)
ticket = Ticket.objects.get(id=followup.ticket.id)