|
16 | 16 | from stream import serializer |
17 | 17 | from requests.exceptions import MissingSchema |
18 | 18 | from itertools import count |
| 19 | +from uuid import uuid4 |
19 | 20 |
|
20 | 21 | try: |
21 | 22 | from urlparse import urlparse, parse_qs |
@@ -46,18 +47,18 @@ def connect_debug(): |
46 | 47 | client = connect_debug() |
47 | 48 |
|
48 | 49 | counter = count() |
49 | | -test_timestamp = int(time.time()) |
| 50 | +test_identifier = uuid4() |
50 | 51 |
|
51 | 52 |
|
52 | | -def get_random_postfix(): |
53 | | - return '---test_%s-feed_%s' % (test_timestamp, next(counter)) |
| 53 | +def get_unique_postfix(): |
| 54 | + return '---test_%s-feed_%s' % (test_identifier, next(counter)) |
54 | 55 |
|
55 | 56 |
|
56 | 57 | def getfeed(feed_slug, user_id): |
57 | 58 | ''' |
58 | 59 | Adds the random postfix to the user id |
59 | 60 | ''' |
60 | | - return client.feed(feed_slug, user_id + get_random_postfix()) |
| 61 | + return client.feed(feed_slug, user_id + get_unique_postfix()) |
61 | 62 |
|
62 | 63 |
|
63 | 64 | class ClientTest(TestCase): |
@@ -709,7 +710,7 @@ def test_uniqueness_topic(self): |
709 | 710 | self.flat3.follow('user', self.user1.user_id) |
710 | 711 | # add the same activity twice |
711 | 712 | now = datetime.datetime.now(tzlocal()) |
712 | | - tweet = 'My Way %s' % get_random_postfix() |
| 713 | + tweet = 'My Way %s' % get_unique_postfix() |
713 | 714 | activity_data = { |
714 | 715 | 'actor': 1, 'verb': 'tweet', 'object': 1, 'time': now, 'tweet': tweet} |
715 | 716 | self.topic1.add_activity(activity_data) |
|
0 commit comments