-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Try to fix non-determinism in tests #856
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.9.6 on 2016-10-20 16:48 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('resources', '0003_spatialresource'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterModelOptions( | ||
name='resource', | ||
options={'ordering': ('name',)}, | ||
), | ||
migrations.AlterModelOptions( | ||
name='spatialresource', | ||
options={'ordering': ('name',)}, | ||
), | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,6 +47,9 @@ class Resource(RandomIDModel): | |
|
||
history = HistoricalRecords() | ||
|
||
class Meta: | ||
ordering = ('name',) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resources could have the same name so we still have a nondeterministic ordering. It may help to have the resource ID as the second field. On the other hand, this ordering is simply to make testing deterministic. So if all our tests stick to unique resource names, then this should be OK. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Exactly. It's just for testing. |
||
|
||
class TutelaryMeta: | ||
perm_type = 'resource' | ||
path_fields = ('project', 'pk') | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't we agree that: "No more
auto
migrations, please!"There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Crap. You're right. I'll rename it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was just trying to do a quick and dirty fix...