mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Fixed #30388 -- Made inspectdb generate OneToOneFields rather than ForeignKey(unique/primary_key=True).
This commit is contained in:
parent
5df3301aab
commit
0f22671ecb
2 changed files with 10 additions and 6 deletions
|
@ -152,11 +152,11 @@ class InspectDBTestCase(TestCase):
|
|||
output,
|
||||
)
|
||||
self.assertIn(
|
||||
"people_pk = models.ForeignKey(InspectdbPeople, models.DO_NOTHING, primary_key=True)",
|
||||
'people_pk = models.OneToOneField(InspectdbPeople, models.DO_NOTHING, primary_key=True)',
|
||||
output,
|
||||
)
|
||||
self.assertIn(
|
||||
"people_unique = models.ForeignKey(InspectdbPeople, models.DO_NOTHING, unique=True)",
|
||||
'people_unique = models.OneToOneField(InspectdbPeople, models.DO_NOTHING)',
|
||||
output,
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue