'Test domain create with an MX record.
This should have a priority field.'

def test_create_domain_with_mx_record(self):

    fake_dns_instance = FakeDnsInstance()
    t = template_format.parse(domain_only_template)
    mx_record = [{'type': 'MX', 'name': 'example.com', 'data': 'mail.example.com', 'priority': 5, 'ttl': 3600}]
    t['Resources']['domain']['Properties']['records'] = mx_record
    instance = self._setup_test_cloud_dns_instance('dnsinstance_create', t)
    create_args = self._get_create_args_with_comments(mx_record)
    self._stubout_create(instance, fake_dns_instance, **create_args)
    scheduler.TaskRunner(instance.create)()
    self.assertEqual((instance.CREATE, instance.COMPLETE), instance.state)
    self.m.VerifyAll()
