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
python manage.py test | |
.............FF....... | |
====================================================================== | |
FAIL: test_api_should_have_tire_after_service_is_added (eneos.apps.recommendations.tests.RecommendationAPITest) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "/buddy/eneos-pos-web/eneos/apps/recommendations/tests.py", line 32, in test_api_should_have_tire_after_service_is_added | |
response = self.client.get(reverse_lazy('api:recommendation-list')) | |
File "/usr/local/lib/python3.6/site-packages/rest_framework/test.py", line 282, in get | |
response = super(APIClient, self).get(path, data=data, **extra) |
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
>>> from django.db.models import Max, Min | |
>>> Store.objects.annotate(min_price=Min('books__price'), max_price=Max('books__price')) |
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
class Untitled { | |
public static void main(String[] args) { | |
System.out.println("Hello World!"); | |
int max_w = 10; | |
int n = 4; | |
int v[] = {10, 40, 30, 50}; | |
int w[] = { 5, 4, 6, 3}; | |
int max_v = 0; |
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
/usr/local/lib/python3.5/site-packages/multiselectfield/db/fields.py:45: RemovedInDjango110Warning: SubfieldBase has been deprecated. Use Field.from_db_value instead. | |
return metaclass(cls.__name__, cls.__bases__, orig_vars) | |
/usr/src/app/apps/commons/fields.py:5: RemovedInDjango110Warning: SubfieldBase has been deprecated. Use Field.from_db_value instead. | |
class LiveField(models.NullBooleanField, metaclass=models.SubfieldBase): # pylint: disable=no-member | |
/usr/src/app/apps/commons/fields.py:35: RemovedInDjango110Warning: SubfieldBase has been deprecated. Use Field.from_db_value instead. | |
class EmailListField(models.CharField, metaclass=models.SubfieldBase): | |
/usr/src/app/apps/setting/views.py:59: RemovedInDjango110Warning: 'get_field_by_name is an unofficial API that has been deprecated. You may be able to replace it with 'get_field()' |
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
def foo(x): | |
y = _bar(x) | |
z = _baz(x, y) | |
x.frob = bling | |
return x | |
def test_foo(): | |
with mock.patch('path.to.foopy._bar', return_value=1) as bar, mock.patch('path.to.foopy._baz', return_value=2) as baz: | |
zip = foo(5) | |
assert bar.called_once_with(5) |
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
Hi Moritz. Just a feedback that we have contacted Codeship support to see if you guys support automatic build on cross-repo pull request. But the support has been extremely slow. We would get a response every 12 hours or so. To be honest, we came to Codeship coming from TravisCI because Codeship is so big on Docker, and we want to try your Jet platform. | |
But we've had 1) unclear response in regards to Codeship / Jet / Docker / Heroku. | |
and 2/ we thought that Codeship would be able to do automatic build when we do a pull request across different repos. (Fork-Pull Request-Merge model), but to no success. | |
Is there anything you can help us? |
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
// | |
// webpack.dev.js | |
// | |
var loaders = require('./webpack.loaders'); | |
var failPlugin = require('webpack-fail-plugin'); | |
module.exports = { | |
entry: [ | |
'./static/typescripts/index.ts', | |
], |
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
""" | |
Python 3 only, brotha' | |
Credit: http://blog.dscpl.com.au/2015/03/generating-full-stack-traces-for.html | |
""" | |
def full_stack(): | |
tb = sys.exc_info()[2] | |
msg = 'Traceback (most recent call last):\n' | |
for item in reversed(inspect.getouterframes(tb.tb_frame)[1:]): | |
msg += ' File "{1}", line {2}, in {3}\n'.format(*item) |
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
rows = export_order_csv(request.POST) | |
# nested method used only in this method to return a yield encoded data first the yield csv code later | |
def response_generator(): | |
yield u'\ufeff'.encode('utf8') | |
for row in rows: | |
yield writer.writerow(row) | |
pseudo_buffer = Echo() | |
writer = csv.writer(pseudo_buffer) |
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
from pyparsing import * | |
def plain_grammar(): | |
return Word(printables + " ") | |
def command_grammar(): | |
identifier = Word(alphas + '-_') | |
line_with_quotes = quotedString.setParseAction(removeQuotes) | |
plain_value = Word(alphanums + "-_") |