#34852: Django Unit Tests break when using replicated MySQL Cluster v8.0.28
------------------------------------+-------------------------------------
Reporter: Aaron Blair | Owner: Can Huynh
Type: Bug | Status: assigned
Component: Testing framework | Version: 4.1
Severity: Normal | Resolution:
Keywords: Test MySQL Cluster | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
------------------------------------+-------------------------------------
Comment (by Aaron Blair):
Replying to [comment:9 Can Huynh]:
A very simple example:
my_app.models:
{{{
from django.db import models
class Company(models.Model):
name = models.CharField(max_length=30, unique=True)
}}}
my_app/tests/test_models_myapp.py:
{{{
from django.test import TestCase
from my_app.models import Company
class CompanyModelTest(TestCase):
def test_saving_and_retrieving_items(self):
company = Company()
company.name = "ACompany"
company.save()
companies = Company.objects.all()
self.assertEqual(companies.count(), 1)
first_company = companies[0]
self.assertEqual(first_company.name, "ACompany")
}}}
> Replying to [comment:6 Aaron Blair]:
>
> Can you guide me on how you set up your unit test and what your test
output looked like, if possible? I have attached my test suits and test
output, please let me know if there is anything I need to modify. Thank
you in advance and sorry for being inactive for a long time.
>
> [[Image( test_case.png​)]] [[Image(test_output.png)]]
>
--
Ticket URL: <https://code.djangoproject.com/ticket/34852#comment:10>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107018bf3daee22-0fda58b6-0669-4b1b-aa23-bd0e7eb0ce2a-000000%40eu-central-1.amazonses.com.