コード例 #1
0
    def test_equality(self, album):
        a = AlbumsLikes(self.timestamp, self.id, album)
        b = AlbumsLikes(self.timestamp, self.id, None)
        c = AlbumsLikes(self.timestamp, self.id, album)

        assert a != b
        assert hash(a) != hash(b)
        assert a is not b

        assert a == c
コード例 #2
0
    def test_de_json_all(self, client, album):
        json_dict = {
            'timestamp': self.timestamp,
            'id_': self.id,
            'album': album.to_dict()
        }
        albums_likes = AlbumsLikes.de_json(json_dict, client)

        assert albums_likes.timestamp == self.timestamp
        assert albums_likes.id == self.id
        assert albums_likes.album == album
コード例 #3
0
def albums_likes(album):
    return AlbumsLikes(TestAlbumsLikes.timestamp, TestAlbumsLikes.id, album)
コード例 #4
0
    def test_de_json_required(self, client):
        json_dict = {'timestamp': self.timestamp}
        albums_likes = AlbumsLikes.de_json(json_dict, client)

        assert albums_likes.timestamp == self.timestamp
コード例 #5
0
 def test_de_list_none(self, client):
     assert AlbumsLikes.de_list({}, client) == []
コード例 #6
0
 def test_de_json_none(self, client):
     assert AlbumsLikes.de_json({}, client) is None