Skip to content

Instantly share code, notes, and snippets.

class HandList(generics.ListCreateAPIView):
serializer_class = HandSerializer
def get_queryset(self):
return Hand.objects.all().filter(user__username=self.request.user)
def perform_create(self, serializer):
deck = None
(goards) ktruong:converge_api ktruong$ python manage.py test goals.tests.test_views.TestHands.test_post_hand_with_deck
Creating test database for alias ‘default’…
System check identified no issues (0 silenced).
E
======================================================================
ERROR: test_post_hand_with_deck (goals.tests.test_views.TestHands)
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
Traceback (most recent call last):
File “/Users/ktruong/git_projects/converge-api/converge_api/goals/tests/test_views.py”, line 261, in test_post_hand_with_deck
self.assertTrue(Hand.objects.get(name=’hand1').deck.name == ‘deck1’)
Creating test database for alias ‘default’…
System check identified no issues (0 silenced).
hit perform_create
hit the try guys
deck does not exist
fail
E
======================================================================
ERROR: test_post_hand_with_deck (goals.tests.test_views.TestHands)
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
(goards) ktruong:converge_api ktruong$ python manage.py test goals.tests.test_views.TestHands.test_post_hand_with_deck
Creating test database for alias ‘default’…
System check identified no issues (0 silenced).
Python 3.6.1 (default, Apr 4 2017, 09:40:21)
Type “copyright”, “credits” or “license” for more information.
IPython 5.3.0 — An enhanced Interactive Python.
? -> Introduction and overview of IPython’s features.
%quickref -> Quick reference.
help -> Python’s own help system.
object? -> Details about ‘object’, use ‘object??’ for extra details.
import { createGoal } from './actions'
import { selectAuthenticating } from './selectors';
import App from '../App';
import React from 'react';
import AppRoutes from '../../routes/AppRoutes';
export class AppContainer extends React.Component {
constructor(props) {
super(props);
this.state = { data: true };
}
import React from 'react';
import AppRoutes from 'routes/AppRoutes';
export class AppContainer extends React.Component {
constructor(props) {
super(props);
this.state = { data: true };
}
import React from 'react';
import Box from './styles/Box
export class App extends React.Component {
render() {
return (
<Box />
);
}
}
import styled from 'styled-components';
export const Box = styled.div`
display: inline-block;
background: pink;
width: 200px;
height: 200px;
transition: transform 300ms ease-in-out;
&:hover {
import React from 'react';
import Box from './styles/Box
import Trigger from './styles/Trigger;
export class App extends React.Component {
render() {
return (
<Trigger>
<Box />
</Trigger>