-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* test fixes and CR changes * fix tests
- Loading branch information
Showing
6 changed files
with
34 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -180,10 +180,6 @@ def test_pre_save_calls_save_shard(self): | |
|
||
class PostgresShardIdFieldTestCase(TestCase): | ||
|
||
def setUp(self): | ||
from django.contrib.auth import get_user_model | ||
self.user = PostgresShardUser.objects.create_user(username='username', password='pwassword', email='[email protected]') | ||
|
||
@unittest.skipIf(settings.DATABASES['default']['ENGINE'] not in Backends.POSTGRES, "Not a postgres backend") | ||
def test_check_shard_id_function(self): | ||
cursor = connections['default'].cursor() | ||
|
@@ -201,7 +197,8 @@ def test_check_shard_id_function(self): | |
|
||
@unittest.skipIf(settings.DATABASES['default']['ENGINE'] not in Backends.POSTGRES, "Not a postgres backend") | ||
def test_check_shard_id_returns_with_model_save(self): | ||
created_model = PostgresCustomIDModel.objects.create(random_string='Test String', user_pk=self.user.id) | ||
user = PostgresShardUser.objects.create_user(username='username', password='pwassword', email='[email protected]') | ||
created_model = PostgresCustomIDModel.objects.create(random_string='Test String', user_pk=user.id) | ||
self.assertTrue(getattr(created_model, 'id')) | ||
|
||
# Same as above, lets create an id that would have been made 10 seconds ago and make sure the one that was | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters