Update README S3 example to actually work.
This commit is contained in:
parent
fe1f3ec06c
commit
f805717231
1 changed files with 4 additions and 1 deletions
|
|
@ -37,10 +37,13 @@ from mymodule import MyModel
|
|||
|
||||
@mock_s3
|
||||
def test_my_model_save():
|
||||
conn = boto.connect_s3()
|
||||
# We need to create the bucket since this is all in Moto's 'virtual' AWS account
|
||||
conn.create_bucket('mybucket')
|
||||
|
||||
model_instance = MyModel('steve', 'is awesome')
|
||||
model_instance.save()
|
||||
|
||||
conn = boto.connect_s3()
|
||||
assert conn.get_bucket('mybucket').get_key('steve') == 'is awesome'
|
||||
```
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue