X Tutup
Skip to content

Commit 66766c2

Browse files
committed
fix issue 374 where tweet_volume data was not being populated on Trend instantiation
1 parent 99e0cff commit 66766c2

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

doc/changelog.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
Changelog
22
---------
33

4+
Version 3.2
5+
===========
6+
7+
What's Changed
8+
--------------
9+
10+
* :py:func:`twitter.models.Trend`'s `volume` attribute has been renamed `tweet_volume` in line with Twitter's naming convention. This change should allow users to access the number of tweets being tweeted for a given Trend.
11+
412
Version 3.1
513
==========
614

testdata/models/models_trend.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"name":"#ChangeAConsonantSpoilAMovie","url":"http:\\/\\/twitter.com\\/search?q=%23ChangeAConsonantSpoilAMovie","promoted_content":null,"query":"%23ChangeAConsonantSpoilAMovie","tweet_volume":null}
1+
{"name":"#ChangeAConsonantSpoilAMovie","url":"http:\\/\\/twitter.com\\/search?q=%23ChangeAConsonantSpoilAMovie","promoted_content":null,"query":"%23ChangeAConsonantSpoilAMovie","tweet_volume":104403}

tests/test_models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ def test_trend(self):
116116
self.fail(e)
117117
self.assertTrue(trend.AsJsonString())
118118
self.assertTrue(trend.AsDict())
119+
self.assertEqual(trend.tweet_volume, 104403)
119120

120121
def test_url(self):
121122
url = twitter.Url.NewFromJsonDict(self.URL_SAMPLE_JSON)

twitter/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def __init__(self, **kwargs):
208208
'query': None,
209209
'timestamp': None,
210210
'url': None,
211-
'volume': None,
211+
'tweet_volume': None,
212212
}
213213

214214
for (param, default) in self.param_defaults.items():

0 commit comments

Comments
 (0)
X Tutup